![](/img/trans.png)
[英]Enable/Disable button based on row selection in datagrid in Flex 3
[英]Flex datagrid column disable and enable
在我的Flex應用程序中,我使用帶有以下列的datagrid
<mx:DataGrid x="10" y="265" width="1205" dataProvider="{vendors}" editable="true" lockedColumnCount="4" horizontalScrollPolicy="on">
<mx:DataGridColumn headerText="Select" editable="false" textAlign="center" >
<mx:itemRenderer >
<mx:Component>
<mx:CheckBox click="data.select = !data.select" change="outerDocument.addDetail(data)" selected="{data.select}" >
</mx:CheckBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="One" dataField="one" color="black" editable="false" width="125" />
<mx:DataGridColumn headerText="Two" dataField="two" color="black" editable="false" width="125"/>
<mx:DataGridColumn headerText="Three" dataField="three" color="black" editable="false"/>
</mx:DataGird>
現在我想在獲取數據時禁用復選框列..如果用戶選擇了datagrid中的任何字段進行編輯,則在datagrid中填充了數據之后。應啟用所選行的復選框...應禁用其他行的復選框..
我希望這些信息足以滿足此要求
任何想法嗎? 提前謝謝...
我不完全理解您的問題,但試圖回答。
<mx:DataGrid x="10" y="265" width="1205" dataProvider="{vendors}" editable="true" lockedColumnCount="4" horizontalScrollPolicy="on" id="dgGrid">
<mx:DataGridColumn headerText="Select" editable="false" textAlign="center" >
<mx:itemRenderer >
<mx:Component>
<mx:CheckBox click="data.select = !data.select" change="outerDocument.addDetail(data)" selected="{data.select}"
enabled="{outerDocument.dgGrid.selectedIndex==outerDocument.vendors.getItemIndex(data)}>
</mx:CheckBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="One" dataField="one" color="black" editable="false" width="125" />
<mx:DataGridColumn headerText="Two" dataField="two" color="black" editable="false" width="125"/>
<mx:DataGridColumn headerText="Three" dataField="three" color="black" editable="false"/>
</mx:DataGird>
如果您的網格數據提供者是一個聲明為public的arrayCollection,則它將起作用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.