views:

627

answers:

1

In datagrid i shows number of checkbox for example 20 checkboz ,in 20 checkbox if i select any 15 checkboxs then remining checkboxs will be disable (enabled="false" But 15 selected checkbox accessable ? How can i do that . i tried

  <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" 
        dataProvider="{dp}">
        <mx:columns>
                <mx:DataGridColumn dataField="name" headerText="Name"/>
                <mx:DataGridColumn headerText="Checked" dataField="checked">
                  <mx:itemRenderer>
                    <mx:Component>
                      <mx:CheckBox enabled="{data.checked}" change="{data.checked = this.enabled;}" />
                    </mx:Component>
                  </mx:itemRenderer>
                </mx:DataGridColumn>
        </mx:columns>
    </mx:DataGrid>
+2  A: 

You are going to need more robust item renderers (in separate class) that dispatch events up through the grid and into the containing class to perform some business logic on the data provider.

Part 3 of Peter Ent's excellent series on Flex item renderers covers this topic in depth. I highly recommend the entire series if you want in depth knowledge of how to best utilize item renderers in Flex.

Joel Hooks
Thank you for your reference .
R.Vijayakumar