1 Reply Latest reply on Oct 16, 2007 5:05 AM by atta707

    CheckBox doesn't dispatch itemClick in DataGrid?

    cmarkiewicz
      I have a DataGrid with a CheckBox in each row. The DataGrid includes an attribute to catch the itemClick event - however it doesn't work when the CheckBox is checked or unchecked. Is this because the CheckBox is a separate component in the DataGrid?

      Also, I have tried to create the CheckBox with two different pieces of code - each is shown below. The first works fine, but the second throws an error when I click on more than one CheckBox. What is the proper way to expand code 1 into code 2? (So that I can control the layout, etc)

      code 1)
      <mx:DataGridColumn headerText="Non Pt" dataField="nonPartFlag"
      itemRenderer="mx.controls.CheckBox"
      rendererIsEditor="true" editorDataField="selected"/>

      code 2)
      <mx:DataGridColumn dataField="nonPartFlag" headerText="Non Pt" width="60"
      rendererIsEditor="true" editorDataField="selected"
      >
      <mx:itemRenderer >
      <mx:Component>
      <mx:VBox horizontalAlign="center">
      <mx:CheckBox/>
      </mx:VBox>
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>

      Thanks
      Chris