Our blazing fast Grid component built with pure JavaScript


Post by md shazeb »

Hello Team Bryntum,

I am trying to implement server side sorting. The column data and row data both is coming from a single api call.I have used data and columns property for that . But if i have to implement server side sorting i have to use store ?. So is it fine to use both store and data or if not can i implement server side sorting without store.


Post by alex.l »

Thanks for opening separated thread!

Grid's AjaxStore cannot get columns and data together.
We do not recommend to use data and AjaxStore together. You should use static data, or remote data, not both.

Columns may be managed with https://bryntum.com/docs/grid/api/Grid/data/ColumnStore anytime. So you can set data to that store after your API call.

Remote sorting are supported by our AjaxStore. So just set URLs and sortParamName, I see from your code, you already know how to do that.

You also could make sorting by your own. There is an event https://bryntum.com/docs/grid/api/Core/data/mixin/StoreSort#event-sort
that you can subscribe on, make your own API call and set data, if you prefer that way.

All the best,
Alex


Post by md shazeb »

I am sending the initial row data which has been sorted by name . I just want to show the data as it has been send by the server and just change the sorting indicator. Now what is happening if i give the particular field name and sortAscending in sorters. it is also doing the sorting part on client. I just dont want sorting to take place on client and i have given sortParamName property but it is still doing the sorting initially according to whatever it has in sorters.

Can you pkease help me with this ?


Post by alex.l »

How did you set initial dataset? In case you set sortParamName, that means remote sorting mode is enabled; set readUrl for the Store, set sorters for the Store that should be initially used; when data loaded, with sorters you provided, local sorting won't be triggered.
In case local sorting enabled and you loaded data, and some sorters defined, data will be sorted locally.
So, in case you want to have column highlighted as sorted by it, you should configure if it remote sorting or local sorting job.

Could you share your solution with us? It sounds to me like some misconfiguration. I am not sure how did you setup your Store and how you loaded data.

All the best,
Alex


Post Reply