Link to home
Start Free TrialLog in
Avatar of tweensteeples
tweensteeples

asked on

Flex 4.x in-line checkbox item editor/renderer using advanced datagrid control

I need some expert help with this item editor problem. I have the following advanced datagrid control and it is working well using a combobox as an in-line editor, however I need to swap the combobox for a checkbox which seemed straight-forward enough,however, I need the checkbox item editor / rendererer to do the following:

1. When the checkbox is selected the data in the cell needs to change to "true" as it does with the combobox.
2. Checkbox item editor/renderer needs to display the true or false value as selected or not selected, just as the combobox does.
3. Checkbox must not display in grouping header field. It must only display in the children of the grouping collection. (grouping collection is not shown in the code). I tried setting the depth in the datagrid and it still displayed a checkbox in the row(s) containing the grouping field.

For some reason when I change the in-line control to a checkbox and set the       
editorDataField="selected" the cell  the datagrid is not changing the data to the selected value.
I have a "save" button that commits all the changes made to the datagrid to the database and it works beautifully if I use a combobox as an in-line control.

I can get it to dis0play the cell data value by using the item editor and setting editorDataField="selected"

<fx:Declarations>
            <fx:Component id="inlineEditor">
                              <mx:ComboBox >
                                    <mx:dataProvider>
                                          <fx:String>true</fx:String>
                                          <fx:String>false</fx:String>
                                    </mx:dataProvider>
                              </mx:ComboBox>
                        </fx:Component>
</fx:Declarations>      
<mx:AdvancedDataGrid id="adg1" width="79%" height="100%"                               creationComplete="adg1_creationCompleteHandler(event)"
                                           dataProvider="{getAllRolespermissionsResult.lastResult}"
                                           designViewDataType="tree" horizontalScrollPolicy="auto"   editable="true"
                                           width="100%" height="100%">            
                  <mx:columns>                        
                        <mx:AdvancedDataGridColumn width="265" dataField="permission"  
                                                               headerText="Permission"/>
                        <mx:AdvancedDataGridColumn id="g1" width="155" dataField="reportsall"                                                                  
                                                               headerText="Reports All"  editorDataField="selectedItem"
                                                               itemEditor="{inlineEditor}" >
                        </mx:AdvancedDataGridColumn>                        
                  </mx:columns>
</mx:AdvancedDataGrid>
<s:Button  x="10" y="400" label="Save" click="rolespermissionsService.commit()"/>

Your help would be very much appreciated.
Thanks Experts!
ASKER CERTIFIED SOLUTION
Avatar of tweensteeples
tweensteeples

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zzynx
>> I was able to solve this problem
Then please close this question by accepting your own previous comment.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.