Hi, I have an advanced data grid which I populate from an array of
objects, each with a collection of child objects, and it displays fine.
The problem is when I start to make it editable. It seems that setting
the AdvancedDataGrid.editable property to "item" should make my child
objects editable, not the groups, but the parent tree items are
editable, and when I click in a parent line with no associated data
element - such as the From or To column in the example - that's becoming
editable too.
The code below demonstrates this:
// Make data provider:
var test : Array = [{description : "abc",
tiers : [{lowerLimit:1,upperLimit:2,rate:0.3},
{lowerLimit:4,upperLimit:5,rate:0.6},
{lowerLimit:7,upperLimit:8,rate:0.9}]},
{description : "def",
tiers : [{lowerLimit:1,upperLimit:2,rate:0.3},
{lowerLimit:4,upperLimit:5,rate:0.6},
{lowerLimit:7,upperLimit:8,rate:0.9}]}]
rulesGridData = new HierarchicalData(test);
// The data grid
<mx:AdvancedDataGrid id="tiersTable" editable="item"
dataProvider="{rulesGridData}">
<mx:groupedColumns>
<mx:AdvancedDataGridColumn headerText="Name"
dataField="description"/>
<mx:AdvancedDataGridColumn headerText="From"
dataField="lowerLimit"/>
<mx:AdvancedDataGridColumn headerText="To"
dataField="upperLimit"/>
<mx:AdvancedDataGridColumn headerText="Rate"
dataField="rate"/>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
Tim