开发者

Sorting issues in flexigrid with "json" data

开发者 https://www.devze.com 2023-01-05 21:45 出处:网络
I\'m currently using flexigrid to display data in a current project, but am running into issues with its ability to properly sort certain columns that contain dates or numbers. The data is being sent

I'm currently using flexigrid to display data in a current project, but am running into issues with its ability to properly sort certain columns that contain dates or numbers. The data is being sent from a ColdFusion CFC that selects the appropriate data and then delivers it in the proper "json" format. As the date/time stamps and other fields containing numbers are sent as "strings" they do not sort p开发者_如何学JAVAroperly in the data grid.

Is this a limitation of Flexigrid or am I sending the data improperly to Flexigrid? I can provide examples of my code if that is helpful.


Flexigrid doesn't do any sorting at all as far as I remember. It just passes the sorting info to the server. So any issues with sorting data are server-side.

To sort client-side You would have to send all data records instead of n (n per page)

As for selecting and sorting - SQL does not forbid selecting a column twice in a query, so You can

SELECT sth, DATEFORMAT(my_date, sth) as when, my_date ORDER BY my_date;

After selecting data this way You just have to skip my_date when returning JSON for flexigrid.

0

精彩评论

暂无评论...
验证码 换一张
取 消