1 Reply Latest reply on Dec 19, 2011 4:22 PM by supersonicecho

    how to session save an editable data grid when using an editable item renderer check box?

    SSzretter

      I have an itemRenderer in my spark DataGrid containing a CheckBox, and have set the renderIsEditable.   This all seems to work, except that my DataGrid "gridItemEditorSessionSave" event is not thrown.  In the example code below, if I click in to Name or address, make a change and then click or tab out, the session save event is thrown properly so I can save the data.   If I toggle the check box however, the event is not thrown!   The data IS changing though.    I even tried in the example below starting and ending the editor session, which looks ok in debug mode, but the session save handler never get's called for the DataGrid.   How can I have an editable item renderer check box and have it call my save handler properly?

       

       

      <s:DataGrid  id="recsDG"  width="100%" height="100%" dataProvider="{_recs}"
                  
      editable="true" gridItemEditorSessionSave="recsDG_gridItemEditorSessionSaveHandler(event)"  alternatingRowColors="[#FFFFFF, #CCCCCC]">
         
      <s:columns>
             
      <s:ArrayList>

                 
      <s:GridColumn headerText="Name" dataField="name"/>
                 
      <s:GridColumn headerText="address" dataField="address"/>

                 
      <s:GridColumn headerText="active" dataField="active" rendererIsEditable="true">
                     
      <s:itemRenderer>
                         
      <fx:Component>
                             
      <s:GridItemRenderer>
                                 
      <fx:Script>
                                      <![CDATA[
                                          import spark.layouts.RowAlign;
                                      ]]>
                                 
      </fx:Script>
                                 
      <s:CheckBox id="cbActive" selected="@{data.active}" 
                                             
      change="outerDocument.recsDG.startItemEditorSession(rowIndex,columnIndex); outerDocument.recsDG.endItemEditorSession(false);" horizontalCenter="0"/>
                             
      </s:GridItemRenderer>

                         
      </fx:Component>
                     
      </s:itemRenderer>
                 
      </s:GridColumn>
                 
      <!--<s:GridColumn headerText="active" dataField="active">
                      <s:itemEditor>
                          <fx:Component>
                              <s:GridItemEditor>
                                <s:CheckBox id="cbActive" selected="@{value}"   horizontalCenter="0"/>
                              </s:GridItemEditor>

                          </fx:Component>
                      </s:itemEditor>
                  </s:GridColumn> -->


             
      </s:ArrayList> 
         
      </s:columns>
      </s:DataGrid>