Flex:数据库驱动的 DataGrid:箭头消失 [英] Flex: Database driven DataGrid: arrows disappearing

查看:22
本文介绍了Flex:数据库驱动的 DataGrid:箭头消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Flex 中,我使用以下代码允许在 DataGrid 中进行排序(数据在服务器端进行分页和排序).

<前>私有函数 headerReleaseHandler(event:DataGridEvent):void{var column:DataGridColumn = DataGridColumn(event.currentTarget.columns[event.columnIndex]);如果(this.count> 0){if(this.query.SortField == column.dataField){this.query.SortAscending = !this.query.SortAscending;}别的{this.query.SortField = column.dataField;this.query.SortAscending = true;}this.fill();}event.preventDefault();}

这很完美,只是没有显示指示排序的箭头.我怎样才能做到这一点?

谢谢!/尼尔斯

解决方案

这里有一个示例,如果这是您正在寻找的内容:http://blog.flexexamples.com/2008/02/28/displaying-the-sort-arrow-in-a-flex-datagrid-control-without-have-to-click-一列/

您似乎需要刷新数据提供程序使用的集合.

In Flex I'm using the following code to allow sorting in a DataGrid (the data is paged and sorted serverside).


        private function headerReleaseHandler(event:DataGridEvent):void
        {
            var column:DataGridColumn = DataGridColumn(event.currentTarget.columns[event.columnIndex]);

            if(this.count>0)
            {
                if(this.query.SortField == column.dataField)
                {
                    this.query.SortAscending = !this.query.SortAscending;
                }
                else
                {
                    this.query.SortField = column.dataField;
                    this.query.SortAscending = true;
                }
                this.fill();
            }

            event.preventDefault();
        }

This works perfectly, except that the arrows that indicate sorting isn't shown. How can I accomplish that?

Thanks! /Niels

解决方案

There is an example here if this is what you are looking for: http://blog.flexexamples.com/2008/02/28/displaying-the-sort-arrow-in-a-flex-datagrid-control-without-having-to-click-a-column/

It looks like you need to refresh the collection used by your dataprovider.

这篇关于Flex:数据库驱动的 DataGrid:箭头消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆