PDA

View Full Version : Sorting data in JsonStore



defcon1
17 Nov 2009, 7:16 AM
Hi,

I am loading data into a JsonStore and use it with a DataView. Is there a way to
sort the Json-data by a specific field?

Thanks in advance ... :D
d1

defcon1
17 Nov 2009, 7:42 AM
Okay, that was too simple, sorry \:D/



store.sort("myJsonField");

Mike Robinson
17 Nov 2009, 9:16 AM
Notice that there are two ways in which sorting can techinically be accomplished: client-side or server-side. The API is the same but the execution is different. Your JSON data-provider should expect and be able to handle a "ORDER BY" directive offered by the client.

Necessarily, this means that sorting (like everything else) must be thought of as being asynchronous. It might involve a trip to the server, who does a requery. Which might involve doing some updates first. :-? As an interesting music documentary I recently watched put it: "It might get loud ..."