Results 1 to 5 of 5

Thread: [4.1.3] Lockable grid giving a string instead of a Ext.data.Store on reconfigure

Hybrid View

Previous Post Previous Post   Next Post Next Post
    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    88
    Vote Rating
    5
      0  

    Default [4.1.3] Lockable grid giving a string instead of a Ext.data.Store on reconfigure

    So I am seeing a really odd issue where lockable ('enableLocking: true') grids are firing reconfigure events with a string instead of a store object.

    The string itself is the correct store class, so I can workaround the issue by downing a StoreManager lookup, but it isn't obeying the documented event signature.

    This is the definition of reconfigure in Ext.panel.Table,

    Code:
        reconfigure: function(store, columns) {
            var me = this,
                view = me.getView(),
                originalDeferinitialRefresh,
                oldStore = me.store,
                headerCt = me.headerCt,
                oldColumns = headerCt ? headerCt.items.getRange() : me.columns;
    
    
            // Make copy in case the beforereconfigure listener mutates it.
            if (columns) {
                columns = Ext.Array.slice(columns);
            }
    
    
            me.fireEvent('beforereconfigure', me, store, columns, oldStore, oldColumns);
            if (me.lockable) {
                me.reconfigureLockable(store, columns);
            } else {
                Ext.suspendLayouts();
                if (columns) {
                    // new columns, delete scroll pos
                    delete me.scrollLeftPos;
                    headerCt.removeAll();
                    headerCt.add(columns);
                }
                if (store) {
                    // Only unbind the store if a new one was passed
                    if (me.store) {
                        me.unbindStore();
                    }
                    store = Ext.StoreManager.lookup(store);
    
    
                    // On reconfigure, view refresh must be inline.
                    originalDeferinitialRefresh = view.deferInitialRefresh;
                    view.deferInitialRefresh = false;
                    me.bindStore(store);
                    view.deferInitialRefresh = originalDeferinitialRefresh;
                } else {
                    me.getView().refresh();
                }
                headerCt.setSortState();
                Ext.resumeLayouts(true);
            }
            me.fireEvent('reconfigure', me, store, columns, oldStore, oldColumns);
        }
    It looks like when the method goes into reconfigureLockable it never assigns store to the store object. and thus fireEvent will fire with a String in the store variable.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Can I get a local test case to reproduce this?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    88
    Vote Rating
    5
      0  

    Default

    If you create a grid with enableLocking: true, put a listener on the grid.reconfigure event and reconfigure the store on the grid, you should see store being passed into the event handler as a string.

    Sorry the example in my codebase is to convoluted for me to post on a forum, but looking at the code it is clear to me that store will never be a Ext.data.Store as documented when taking the lockable code path.

  4. #4
    Sencha Premium User mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,078
    Vote Rating
    184
      0  

    Default

    So you're calling reconfigure with a string as the store?


    Code:
    grid.reconfigure(storeAsString)
    API dictates it should be a real store instance... http://docs.sencha.com/ext-js/4-1/#!...od-reconfigure

  5. #5
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    88
    Vote Rating
    5
      0  

    Default

    Ah, yes I was using a store id string instead of of a store object, my bad. Once I corrected that it looks like it works as expected. Sorry about the false alarm.

    So I see that is documented in the signature, but why does the standard reconfigure and a locked grid reconfigure both do a lookup on the store if it's expected to be a store object?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •