0 Replies Latest reply on May 1, 2008 6:46 AM by uri*1

    Advanced Data Grid customized renderers interaction

    uri*1
      I created an advancedDataGrid with two customized colums:
      The first has a customized item renderer which is used also as the item editor and it is a check box.
      The second has a customized item editor - once the cell is clicked, a button appears. When the button is clicked - a popup window appears for selection. the selection is the new text of the cell.
      Seperatly, they work fine. There is only one scenario where the check box disturbs the button - When the check box is clicked and without exiting the row, the other customized cell is edited, its item rendered does not get updated.
      Here is the grid's colum definition:

      <mx:AdvancedDataGrid id="dataGrid"
      allowDragSelection="false"
      draggableColumns="false"
      editable="true"
      width="100%" height="100%"
      dataProvider="{dataGridSource}"
      defaultLeafIcon="{null}"
      folderClosedIcon="{null}"
      folderOpenIcon="{null}"
      change="onRowSelectionChanged(event)"
      itemEditEnd="onItemEndEdit(event)"
      <mx:columns>

      <mx:AdvancedDataGridColumn dataField="isSelected" headerText="" width="20"
      rendererIsEditor="true"
      editorDataField="selected"
      >
      <mx:itemRenderer>
      <mx:Component>
      <mx:CheckBox selectedField="selected" change="data.isSelected = selected; StatesTable(document).updateDashletState(data)"/>
      </mx:Component>
      </mx:itemRenderer>

      </mx:AdvancedDataGridColumn>
      <mx:AdvancedDataGridColumn id="statesColumn" dataField="event" headerText="{ResourceManager.getString('state_grid_header')}" editable="false" width="150" labelFunction="localizeLabelFunction"/>
      <mx:AdvancedDataGridColumn dataField="dashletName" headerText="{ResourceManager.getString('dashlet_grid_header')}" width="150" editable="false"/>
      <mx:AdvancedDataGridColumn dataField="contentName" headerText="{ResourceManager.getString('report_grid_header')}"
      width="180" itemEditor="com.documentum.bpm.dashboard.components.configuration.DataGridReportChooser"
      editorDataField="selectedItem"/>

      </mx:columns>
      </mx:AdvancedDataGrid>

      //this code is for preventing default behavior of the item editor for the customized item editor for opening a popup window instead:
      private function onItemEndEdit(event:AdvancedDataGridEvent):void
      {
      var item:Object = dataGridSource.getItemAt(event.rowIndex);


      if (event.dataField == "contentName")
      event.preventDefault();
      }
      Please help