首页 > 编程 > .NET > 正文

asp.net DataGrid 中文字符排序的实现代码

2024-07-10 12:38:36
字体:
来源:转载
供稿:网友
废话不多说,看例子:
代码如下:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="12">
    <mx:Script>
        <!--[CDATA[
            import com.SortUtil;
            import mx.events.DataGridEvent;
            import mx.collections.ArrayCollection;
            [Bindable]
            private var ar:ArrayCollection = new ArrayCollection(
                [{fieldA:"aaa", fieldB:"中文zhongwen"},
                {fieldA:"bbb", fieldB:"字符zifu"},
                {fieldA:"ccc", fieldB:"测试ceshi"},
                {fieldA:"ddd", fieldB:"排序paixu"},
                {fieldA:"eee", fieldB:"功能gongneng"},
                {fieldA:"fff", fieldB:"示例shili"},
                {fieldA:"ggg", fieldB:123},
                {fieldA:"hhh", fieldB:false},
                {fieldA:"iii", fieldB:"aaa"},
                {fieldA:"iii", fieldB:"ggg"},
                {fieldA:"jjj", fieldB:"1a2b"}]
                );

            private function onHeadReleaseHandle(event:DataGridEvent):void
            {
                SortUtil.setDataField(event.dataField);
            }
        ]]-->
    </mx:Script>
    <mx:DataGrid width="100%" height="300" dataProvider="{ar}" headerRelease="onHeadReleaseHandle(event)">
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表