Hello,
I am using e4x format to get the data from database and converting XMLList into
an Arraycollection to be used as dataprovider for datagrid. After
adding/updating data I want to write it back to database. I have added Add/Edit
Flag in the dataprovider and based on that I am creating a new Array to write
only modified data. The problem is after update I am getting mix format in my
Array. The modified columns are appearing as String whereas unchanged columns
as XML. Please suggest how to fix this issue.
Thanks
Arshad
--------------------------------------
Data Provider values before Edit
cash XML
<stringValue type="xsd:string" xmlns:ns5="http://----------->
"Y"
code XML
<stringValue type="xsd:string" xmlns:ns5="http://----------->
"0211"
description XML
<stringValue type="xsd:string" xmlns:ns5="http://----------->
"Amendment Liability"
entry_label XML
<stringValue type="xsd:string" xmlns:ns5="http://----------->
"Amendment Liability"
Data Provider value after Edit
cash XML
<stringValue type="xsd:string" xmlns:ns5="http://----------->
"Y"
code "0211"
description "After Edit"
entry_label "New Label"
--------
On datagrid I am using following function on itemEditEnd
public function chEdit(event:DataGridEvent):void{
var dgCurrentCol:String = event.dataField;
var dgOldColVal:String = "";
var dgNewColVal:String =
TextInput(event.currentTarget.itemEditorInstance).text;
if (dgCurrentCol == 'code'){
trace(dgGrid.selectedItem.valueOf());
dgOldColVal =
dgGrid.dataProvider[dgGrid.selectedIndex].code;
dgGrid.dataProvider[dgGrid.selectedIndex].code =
dgNewColVal
}
if (dgCurrentCol == 'description'){
dgOldColVal =
dgGrid.dataProvider[dgGrid.selectedIndex].description;
dgGrid.dataProvider[dgGrid.selectedIndex].description =
dgNewColVal
}
if (dgCurrentCol == 'entry_label'){
dgOldColVal =
dgGrid.dataProvider[dgGrid.selectedIndex].entry_label;
dgGrid.dataProvider[dgGrid.selectedIndex].entry_label = dgNewColVal