[CLOSED] Paging Toolbar Exception

  1. #1

    [CLOSED] Paging Toolbar Exception

    We are getting another exception while closing/destroying a Panel inside a TabPanel.
    This time we got a GridPanel with PagingToolbar, FilterHeader and many columns inside a Panel in a TabPanel.
    When the Tab/Panel is closed a JavaScript exception is thrown:
    ext.axd?v=4.8.1:8134 Uncaught TypeError: Cannot read property 'apply' of null
        at constructor.aliasOneMember.<computed> [as on] (ext.axd?v=4.8.1:8134)
        at constructor.onLoad (ext.axd?v=4.8.1:12800)
        at Object.elevate (ext.axd?v=4.8.1:1926)
        at timerFn (ext.axd?v=4.8.1:4838)
            createAlias: flexSetter(function(alias, origin) {
                aliasOneMember[alias] = function() {
                    return this[origin].apply(this, arguments);
                };
                this.override(aliasOneMember);
                delete aliasOneMember[alias];
            })
    With some debugging I was able to find the cause of the problem.
    It looks like the store in the GridPanel is destroyed and set to null, which causes the PagingToolbar to refresh the store it is bind to and tries to load new data from the "ext-empty-store" which causes the exception because the store isn't there anymore.

    My current workaround is to override the bindStore method of Ext.toolbar.Paging and add a return statement if the store variable is set to "ext-empty-store".

    Ext.toolbar.Paging.override({
        bindStore: function(store, initial, propertyName) {
            var isEmpty = store === 'ext-empty-store' && initial;
    
            if (store && !isEmpty) {
                store = Ext.data.StoreManager.lookup(store);
            }
    
            if (!store || isEmpty) {
                if (this.ownerCt) {
                    store = this.findStore();
                } else {
                    store = 'ext-empty-store';
                    this.needFindStore = true;
    
                    return;
                }
            }
    
            this.callParent([store, initial, propertyName]);
        }
    });
    Currently I'm unable to reproduce this in a sample application, but maybe you are able to find the bug with the informations provided.
    It looks like it can be a timing problem, because there are some timer functions involved and the problem disappears if the amount of columns in the GridPanel is reduced.
  2. #2
    Hello @anwichmann!

    Thanks for sharing not only the issue you found with Ext.NET, but also how you got rid of it. We'll may try to guess a scenario and merge a fix to our code, but it's less likely without a clear way to reproduce the issue. Sometimes third-party libraries, browser discrepancies, may be affecting how the scripts are run, and this would make it very difficult to come up with the actual scenario required to reproduce the issue.

    Hope you understand. Please don't hesitate to post if you identify a way to consistently reproduce the issue.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Grid Paging Toolbar and Local paging with Remote Data
    By edip in forum 4.x Legacy Premium Help
    Replies: 5
    Last Post: Nov 29, 2016, 8:31 PM
  2. [CLOSED] paging toolbar loses filter params when paging
    By ecko in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Mar 08, 2013, 10:15 AM
  3. Paging Toolbar Problem?
    By healingnations in forum 1.x Help
    Replies: 1
    Last Post: Nov 01, 2012, 7:16 AM
  4. Replies: 11
    Last Post: Jun 13, 2012, 4:53 PM
  5. Paging and Sorting Example throws exception
    By Skorfulose in forum 1.x Help
    Replies: 1
    Last Post: Nov 19, 2009, 3:30 AM

Posting Permissions