以下是示例代码。
当我开始在 optionId 列或 option 列中进行编辑时,同一列的其他行也会受到影响并反映相同的值。但是当我在其他列中进行编辑时,它工作正常......不知道原因。如果有人可以帮助我。
<mx:AdvancedDataGrid id="electionGrid" width="100%" height="70%" folderOpenIcon="{null}" folderClosedIcon="{null}" defaultLeafIcon="{null}" editable="true">
<mx:dataProvider>
<mx:HierarchicalData source="{electionSummary}" childrenField="options"/>
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGridColumn dataField="dbProduct" headerText="DB Product" editable="false"/>
<mx:AdvancedDataGridColumn dataField="entitledQty" headerText="Entitled Quantity" editable="false"/>
<mx:AdvancedDataGridColumn dataField="entityId" headerText="Entity Id" editable="false"/>
<mx:AdvancedDataGridColumn dataField="entityName" headerText="Entity Name" editable="false"/>
<mx:AdvancedDataGridColumn dataField="eventStatus" headerText="Event Status" editable="false"/>
<mx:AdvancedDataGridColumn dataField="optionId" headerText="Option Id" itemEditor="mx.controls.TextInput" editorDataField="text"/>
<mx:AdvancedDataGridColumn dataField="option" headerText="Description" itemEditor="mx.controls.TextInput" editorDataField="text"/>
</mx:columns>
</mx:AdvancedDataGrid>
层次数据:
<mx:ArrayCollection id="optionData">
<model:CAEventOption optionId="12345" option="Option1"/>
<model:CAEventOption optionId="56789" option="Option2"/>
<model:CAEventOption optionId="89756" option="Option3"/>
</mx:ArrayCollection>
<mx:ArrayCollection id="electionSummary">
<model:ElectionStatusSummary dbProduct="Global PB" entitledQty="54500" entityId="DEM0001" entityName="Hedge Fund Long Short Period"
eventStatus="Awaiting Election" options="{new ArrayCollection(optionData.source)}"/>
<model:ElectionStatusSummary dbProduct="Global PB" entitledQty="54500" entityId="DEM0001" entityName="Hedge Fund Long Short Period"
eventStatus="Awaiting Election" options="{new ArrayCollection(optionData.source)}"/>
<model:ElectionStatusSummary dbProduct="Global PB" entitledQty="54500" entityId="DEM0001" entityName="Hedge Fund Long Short Period"
eventStatus="Awaiting Election" options="{new ArrayCollection(optionData.source)}"/>
</mx:ArrayCollection>