1. #1
    Sencha User
    Join Date
    Nov 2010
    Location
    Ukraine
    Posts
    11
    Vote Rating
    0
    NexusOne is on a distinguished road

      0  

    Default onPageMapClear: Uncaught TypeError: Cannot convert null to object

    onPageMapClear: Uncaught TypeError: Cannot convert null to object


    Uncaught TypeError: Cannot convert null to object (ext-all-debug.js:67570)

    Code:
    onPageMapClear: function() {
            var me = this,
                loadingFlag = me.wasLoading,
                reqs = me.pageRequests,
                req,
                page;
    
            // If any requests return, we no longer respond to them.
            if (me.data.events.pageadded) {
                me.data.events.pageadded.clearListeners();
            }
    
            // If the page cache gets cleared it's because a full reload is in progress.
            // Setting the loading flag prevents linked Views from displaying the empty text
            // during a load... we don't know whether ther dataset is empty or not.
            me.loading = true;
            me.totalCount = 0;
    
            // Cancel all outstanding requests
            for (page in reqs) {
                if (reqs.hasOwnProperty(page)) {
                    req = reqs[page];
                    delete reqs[page]; //delete req
                    delete req.callback; //trying to delete req.callback     
    
                }
            }
    
            // This will update any views. 
            me.fireEvent('clear', me);
    
            // Restore loading flag. The beforeload event could still veto the process.
            // The flag does not get set for real until we pass the beforeload event.
            me.loading = loadingFlag;
        },

  2. #2
    Sencha User
    Join Date
    Nov 2010
    Location
    Ukraine
    Posts
    11
    Vote Rating
    0
    NexusOne is on a distinguished road

      0  

    Default


    Ooops... This is not the reason.

    I have buffered store with remoteFilter = true. So if I make this steps

    Code:
    store.clearFilter();
    store.filter({ property: field, value: val, anyMatch: true });
    I'e got Uncaught TypeError: Cannot convert null to object.
    In some reason reqs[page] is undefined, after I call clearFilter

  3. #3
    Sencha User
    Join Date
    Mar 2013
    Posts
    3
    Vote Rating
    0
    iorlas is on a distinguished road

      0  

    Default


    Same issue.
    Solved temporary with setting
    Code:
    suppressEvent = true
    For example:
    Code:
            @getView().organizationsStore.clearFilter(true)  # clear previous filters
            if @getSearchField().getValue() != ''
                @getView().organizationsStore.filter('name', @getSearchField().getValue())
            @getView().organizationsStore.load()  # load with defined filters

  4. #4
    Sencha User Sharkanana's Avatar
    Join Date
    Nov 2011
    Location
    Charlotte, NC
    Posts
    39
    Vote Rating
    0
    Sharkanana is on a distinguished road

      0  

    Default


    A simple workaround is to:

    Code:
    // Cancel all outstanding requests
                    for (page in reqs)
                    {
                        if (reqs.hasOwnProperty(page))
                        {
                            req = reqs[page];
                            delete reqs[page];
                            if(req)
                                delete req.callback;
                        }
                    }

  5. #5
    Sencha User
    Join Date
    Feb 2013
    Posts
    36
    Vote Rating
    0
    leksodav is on a distinguished road

      0  

    Default


    where is this suspendevent?
    or is there any solution?