PDA

View Full Version : [CLOSED] Store client side .getSortState() replacement



vadym.f
May 01, 2013, 12:01 PM
Hi,

The .getSortState() store method has been removed and it's obviously another breaking change to the client side Store model. I'm curious what's recommended as a functional replacement. On the surface, it's probably store.sorters property but I couldn't figure out how to use it yet.

http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.Store

Daniil
May 01, 2013, 1:51 PM
Hi Vadym,

Added a new breaking change item.

173. The Store's getSortState client side method has been removed. Please use its sorters property, it is a MixedCollection instance.

The MixedCollection API:
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.util.MixedCollection

vadym.f
May 01, 2013, 2:37 PM
Thanks for the info Daniil,

I'm going to use a port like this:



var sortStates=[];
store.sorters.each(function (item, index) {
var sortState = {};
sortState.field = item.property;
sortState.direction = item.direction;
sortStates.push(sortState);
});


You may close this thread down.