AdvancedDataGrid 多列编程排序
我需要在 AdvancedDataGrid 上进行编程多列排序。 问题是,目前我正在网格上实现分页。 因此,如果我对数据进行排序,则只会对特定页面进行排序。 因此,我需要按列条件对整个列表进行排序。
我尝试了 HeaderRelease 事件,但我想它没有用,因为我需要对服务器进行往返调用以获取排序后的数据。 我有什么办法可以实现这一点吗? 我还需要在列标题的右侧位置显示排序标记,指示排序编号和方向。
非常感谢您的帮助,
谢谢:)
I need to to a programmatic multi column sorting on the AdvancedDataGrid.
The issue is, currently I am implementing paging on my grid. So, if I sort the data, only the perticular page is being sorted. So, I need to sort the entire list by the column criteria.
I tried HeaderRelease event, but I guess it is of no use as I need to make a round trip call to the server to get the sorted data. Is there any way I can implement that. I also need to show the sort markers in the Column headers' right position, indicating the sort numbers and direction.
'll really appreciate the help
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您需要扩展 AdvancedDataGrid 并覆盖 sortHandler
You need to extend the AdvancedDataGrid and override the sortHandler
如果您的数据已分页,则无论如何您都必须前往服务器检索数据。 如果仅部分数据存储在客户端,则最好在服务器上排序,因为只有服务器才会拥有所有数据。
If your data is paged, you'll have to go to the server to retrieve the data anyways. If only a portion of the data is stored client side, it might be better to just sort on the server, since only the server will have all the data.
创建您自己的自定义高级数据网格,如下例所示。
您拥有已排序列的数组和顺序。 发送一个自定义事件并将该数组传递给它。 服务器端Tech将进行相应的查询并返回结果。
Create your own custom Advance Datagrid as given in the example below.
You have the array of sorted columns and the order. Send a cutom event and pass this array to it. The server side Tech will make the query accordingly and return you the result.
对不起大家!! 错过了代码的初始部分......这是正确的代码
SORRY Guys!! Missed the inital part of the code.... Here is the right code
尝试修改排序事件的事件优先级,无需重写排序处理程序,但无法在 mxml 中完成。
Try modifiyng the event priority of the sort event, no need to override the sort handler, but can't be done in mxml.
您还可以查看
AdvancedDataGridSortItemRenderer
类。 这有助于自定义排序项渲染器。You can also have a look at the
AdvancedDataGridSortItemRenderer
class. This helps to customise the sort item renderer.