`

一个例子:不修改GataGrid选中的内容,实现可以复制GataGrid选中的内容

阅读更多

代码如下test.mxml:


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
    <mx:Script>
        <![CDATA[            
            [Bindable]
            private var dg_item_editor :ClassFactory = new ClassFactory(myItemEditor );
            [Bindable]
            public var dg_data :Array=[{'name':'Jack','sex':'男','age':'24'},
                                      {'name':'Tom','sex':'女','age':'20'}];            
        ]]>
    </mx:Script>   
<mx:Panel>
    <mx:DataGrid width="100%" height="100%" dataProvider="{dg_data }" editable="true">
                <mx:columns>
                    <mx:DataGridColumn dataField="name" itemEditor="{dg_item_editor }"/>
                    <mx:DataGridColumn dataField="sex" itemEditor="{dg_item_editor }"/>
                    <mx:DataGridColumn dataField="age" itemEditor="{dg_item_editor }"/>
                </mx:columns>
    </mx:DataGrid>
</mx:Panel>
</mx:Application>

 

myItemEditor.mxml 代码如下:

<?xml version="1.0" encoding="utf-8"?>
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml" editable="false"/>

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics