0

我想在道场增强网格(通过 JsonRestStore 连接到数据库)中对信息进行排序。我知道道场网格提供了基于单列进行排序的功能。但是,在我的网格中,一列包含来自数据库表的多个字段(例如,姓、名、电子邮件、年龄)的组合信息。有没有一种简单的方法可以根据数据库表中的单个字段(例如姓氏)对网格或存储中的数据进行排序?

似乎我可以使用“查询”来更改商店的视图(如果我理解正确,网格是商店的视图),但我不明白如何编写查询来做到这一点。谁能给我更多关于使用查询的语法或如何解决这个问题的信息?

谢谢!

4

1 回答 1

0

It looks like you have to use what is called a comparatorMap for customized grid sorting.

here's one example : http://www.ibm.com/developerworks/web/library/wa-aj-dojogrid/index.html (look for the section 'Listing 15. Customize the sort function of Dojo Grid')

inside the comparator map function is where you would convert the strings to numbers and make the numeric comparison.

于 2012-07-13T17:14:01.267 回答