PDA

View Full Version : [CLOSED] Stateful grid store sorter with only sorterFn error on applyState in debug mode



sunsay
17 Apr 2013, 4:54 AM
REQUIRED INFORMATION

Ext version tested:

Ext 4.2.0
Browser versions tested against:

Chrome 26
DOCTYPE tested against:

____
Description:

When a stateful grid has store with some sorter wich has only sorterFn function it does not stored by Ext.util.Sorter::serialize function. So when i reload page with ?debug key (ext-all-dev.js) there is an error in console A Sorter requires either a property or a sorter function
Additional CSS used:

only default ext-all.css
Operating System:

Windows 7

slemmon
17 Apr 2013, 11:41 AM
The stateProvider isn't able to serialize the function to a cookie value. It can serialize config objects, but not a function.

sunsay
17 Apr 2013, 8:41 PM
The stateProvider isn't able to serialize the function to a cookie value. It can serialize config objects, but not a function.

Thank you, Captain Obvious :)
The question is what can be done to avoid the exception, which stops application's loading?
For now there are two ways: 1. make grid not statefull. 2. remove sorters with only sorterFn. But don't you think it is not very well?

slemmon
18 Apr 2013, 2:02 PM
Hmm.. what if you add the sorter to the store via sort() after the grid is rendered?

AJAIN32
18 Nov 2015, 4:52 PM
Hi,

I am also facing the same issue,

how can we add the sorter to the store via sort() after the grid is rendered? will it work when ever we sort on that column ?

If this is a bug, is it solved in EXT 6. I am getting the same error in EXT 6 app. Please suggest!!

Thanks,
Ankit

aisrael
8 May 2017, 2:57 PM
Hi,

I came across the same issue. For me, it turns out it was an issue with the variable 'property' name that I had defined. The app that I've worked on now for over 8 years has been migrated from EXTJS3 to 4, and now to EXTJS6. From 3 to 4 it was fine to use 'field' as the variable name; although 'field' was wrong to use in EXTJS4, it didn't throw an error. But now in EXTJS6, when migrating from 4, I had about 4 stores (of about 70), that had 'field' as the variable 'property' name.

In other words - make sure you are using 'property', NOT 'field' as the sort property.