在 Flex AdvancedDataGrid 中保留行顺序
我有一个 AdvancedDataGrid,允许用户拖动/拖动行以重新排序,还允许它们对列进行排序。我想保存行排序,以便下次加载数据时,保留行排序。
我有一个可绑定到数据网格的数组集合。该数组是自定义 AS 对象的集合。我尝试仅使用提供给数据网格的可绑定数组集合,但顺序始终保持不变。
谢谢。
I have an AdvancedDataGrid that I allow the user to drag/drog the rows to reorder them and also allow them to sort on columns. I want to save the row ordering so that the next time I load up the data, the row ordering is preserved.
I have a bindable array collection to the data grid. The array is a collection of a custom AS object. I tried just using the bindabled array collection I give to the datagrid but the order always stays the same.
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将“sortOrder”成员字段添加到您正在使用的自定义 AS 对象中。当用户在拖动时排序时,可以更新sortOrder变量。
此外,您的 ArrayCollection 还必须添加一个 SortFunction。 (myAc.sort = mySortFunction)。此 SortFunction 将使用 SortField 对“sortOrder”(数字)进行排序。
这应该足以让你继续下去:-)
you'll need to add a 'sortOrder' member field to the custom AS object you're using. When the user sorts when dragging, you can update the sortOrder variable.
Also, your ArrayCollection will have to have a SortFunction added to it. (myAc.sort = mySortFunction). This SortFunction will use SortField to sort on 'sortOrder' (numerically).
That should be enough to get you going :-)