Adobe Flex / Flash CheckBox Renderer Bug in a DataGrid
In Adobe Flash / Flex, sometimes in a DataGrid or AdvancedDataGrid, when checking multiple checkboxes a previously checked CheckBox will drop the check mark. This is really annoying and can cause errors. It’s a documented bug in Flash player that Adobe hasn’t gotten around to fixing. You can however fix it yourself by supplying a custom item renderer for each column with a checkbox.
Basically, create your own renderer based on the CheckBox and supply a click and selected function. The click function is the inverse of the dataField and the selected is just the value of the dataField desired.
<mx:AdvancedDataGrid id=”adList“ editable=”true“ dataProvider=”{aDP}” >
<mx:groupedColumns>
<mx:AdvancedDataGridColumnGroup headerText=”Group1“>
<mx:AdvancedDataGridColumn editable=”false“ headerText=”Col1” dataField=”testA“/>
<mx:AdvancedDataGridColumn textAlign=”center” headerText=”Col2” width=”35” editorDataField=”selected”
rendererIsEditor=”true” dataField=”check” >
<mx:itemRenderer>
<mx:Component>
<mx:CheckBox click=”data.check = !data.check” selected=”{data.check}” />
</mx:Component>
</mx:itemRenderer>
</mx:AdvancedDataGridColumn>
This is bug #16801 in Flash
https://bugs.adobe.com/jira/browse/SDK-16801
Filed under: Technology | Tagged: Adobe, CheckBox, Flash, Flex
















