Flex datagrid column disable and enable
-
27-10-2019 - |
문제
In my flex application im using a datagrid with following columns
<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>
now i want to disable the checkbox column on fetching data..after datas are populated in datagrid if user selects any of the field in datagrid for editing..the checkbox for that selected row should be enabled...other rows checkbox should be disabled..
I hope this information is enough for this requirement
any idea about this?? thankxx in advance...
해결책
I dint understand completely your problem but trying to answer it.
<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>
This will work If your dataprovider for grid is an arrayCollection which is declared as public..
제휴하지 않습니다 StackOverflow