[FIXED] [V0.7] GridPanel.Reload shows DirtyWarning even if WarningOnDirty=False

  1. #1

    [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?
        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
                );
            }
           ...
       }
  2. #2

    RE: [FIXED] [V0.7] GridPanel.Reload shows DirtyWarning even if WarningOnDirty=False

    Doh. Right after I posted this, I realized I can do a store.commitChanges to clear the array of deleted items. But I still think this is a bug.
  3. #3

    RE: [FIXED] [V0.7] GridPanel.Reload shows DirtyWarning even if WarningOnDirty=False

    Hi jchau,

    Yes, you are right, it is a bug. Thanks for bug reporting.

    The fix will be public available in the new Release

Similar Threads

  1. Replies: 2
    Last Post: Mar 04, 2011, 1:16 PM
  2. Radio button values always shows false
    By vs.mukesh in forum 1.x Help
    Replies: 0
    Last Post: Jul 01, 2010, 3:52 PM
  3. [CLOSED] Disabled Checkbox is always false and shows enabled true.
    By Sharon in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 12, 2009, 4:10 AM
  4. Replies: 4
    Last Post: Jun 15, 2009, 10:45 AM
  5. Replies: 3
    Last Post: Apr 18, 2008, 2:50 PM

Posting Permissions