Oct 24, 2008, 6:21 PM
[FIXED] [V0.7] GridPanel.Reload shows DirtyWarning even if WarningOnDirty=False
Here's my scenario: I have a page with tree of folders on the left and a grid of files on the right (simple file explorer layout). There's a button to delete a selected file. When that button is clicked, it does an AjaxEvent to the page to check if file can be deleted. If file can be deleted, AjaxEvent success is set to true. On the button success handler, it does a Grid.deleteSelected().
Now the issue is that after a delete and I click on a different folder, it does a Grid.Reload and prompts me with a Dirty Warning. I have set WarningOnDirty="false" on the store. I spent alot of time debugging this and finally realized this is not an ExtJS thing but a Coolite thing.
In coolite-data.js, Ext.data.Store is extended with a reload function that invokes callbackReload and hardcode dirtyConfirm to true. Shouldn't it use the WarningOnDirty flag?
Now the issue is that after a delete and I click on a different folder, it does a Grid.Reload and prompts me with a Dirty Warning. I have set WarningOnDirty="false" on the store. I spent alot of time debugging this and finally realized this is not an ExtJS thing but a Coolite thing.
In coolite-data.js, Ext.data.Store is extended with a reload function that invokes callbackReload and hardcode dirtyConfirm to true. Shouldn't it use the WarningOnDirty flag?
reload: function(options) {
if (this.proxy.refreshByUrl) {
var opts = options || {};
var prms = opts.params || {};
this.callbackReload(true, prms);
} else {
Coolite.Ext.Store.superclass.reload.call(this, options);
}
},
callbackReload: function(dirtyConfirm, reloadOptions) {
...
if (dirtyConfirm && this.isDirty()) {
Ext.MessageBox.confirm(
this.dirtyWarningTitle,
this.dirtyWarningText,
function(btn, text) {
if (btn == 'yes') {
reload(this, options);
}
},
this
);
}
...
}