PDA

View Full Version : multisort on datastore



PatrickS
5 Oct 2010, 6:17 AM
Hi,

In the API it is stated that one can do a multiSort on a store. As parameter you have to give an array of sorters and a sort direction (multiSort( Array sorters, String direction ) : void)
How can I create the array of sorters? I can't find the appropriate information about that in the api.

Thanks
Patrick

Condor
5 Oct 2010, 6:19 AM
sorters should just be an array of {field, direction} objects (like sortInfo).

PatrickS
5 Oct 2010, 6:50 AM
I tried the following:
var sorter = new Array();

sorter.push({ field: 'fixed_value_description', direction: 'DESC' });
sorter.push({ field: 'fixed_descriptoin', direction: 'DESC' });

articleFeatureStore.multiSort(sorter, 'DESC');This gives an uncaught typeerror: cannot read property 'sortType'of undefined.Patrick

PatrickS
5 Oct 2010, 6:51 AM
ow darn, just after I posted it I saw that it was my Dyslexia that is bugging me :(