In my project I used one select all button for select all checkbox at click event. But I used datagrid, item renderer within checkbox so no id of checkbox then how to select/unselect all checkbox ?
<mx:DataGrid id=newdatagrid>
<mx:columns>
<mx:DataGridColumn headerText="1" rendererIsEditor="true" editorDataField="selected">
<mx:itemRenderer>
<mx:Component>
<mx:CheckBox click="{data.check1 = (data.check1 != 'true') ? 'true' : 'false'};outerDocument.toggleCheckbox(data);outerDocument.calcValues();" dataChange="this.selected=outerDocument.validateCheckbox(data)"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
How can I implement select/unselect all button for checkbox?
Best Solution
First, bind the selected property of your checkbox in the itemrenderer to the "check1" property of your dataprovider items:
Then set the "check1" property of each item in the dataprovider in response to a button click.