0
我正在處理一個正在從過程中獲取的變量中提取信息的數據網格。我需要能夠編輯overpaidAmount列。我已經鎖定了除了需要用戶輸入的列以外的所有列,但是一旦他們添加了信息,我該如何將它分配給變量?在網上隨處看,無法找到這個具體問題的任何東西。datagrid as3 - 如何將編輯後的單元格保存到變量
import fl.controls.DataGrid;
import fl.controls.ScrollPolicy;
import fl.data.DataProvider;
import fl.controls.dataGridClasses.DataGridColumn;
var col1:DataGridColumn = new DataGridColumn("Line");
var col2:DataGridColumn = new DataGridColumn("ServiceCode");
var col3:DataGridColumn = new DataGridColumn("BilledCharge");
var col4:DataGridColumn = new DataGridColumn("Paid");
var col5:DataGridColumn = new DataGridColumn("OverpaidAmount");
datagrid.addColumn(col1);
datagrid.addColumn(col2);
datagrid.addColumn(col3);
datagrid.addColumn(col4);
datagrid.addColumn(col5);
col1.editable = false;
col2.editable = false;
col3.editable = false;
col4.editable = false;
col1.minWidth = 40;
col2.minWidth = 80;
col3.minWidth = 80;
col4.minWidth = 80;
col5.minWidth = 130;
var myData:Array;
if ((majorPercentage1 == "---") || (majorPercentage1 == "000") || (majorPercentage1 == " "))
{
myData =
[
{Line:"1", ServiceCode: cpt1, BilledCharge: charge1, Paid: basicPaid1, OverpaidAmount: overpaidAmount1},
{Line:"2", ServiceCode: cpt2, BilledCharge: charge2, Paid: basicPaid2, OverpaidAmount: overpaidAmount2},
{Line:"3", ServiceCode: cpt3, BilledCharge: charge3, Paid: basicPaid3, OverpaidAmount: overpaidAmount3},
{Line:"4", ServiceCode: cpt4, BilledCharge: charge4, Paid: basicPaid4, OverpaidAmount: overpaidAmount4},
{Line:"5", ServiceCode: cpt5, BilledCharge: charge5, Paid: basicPaid5, OverpaidAmount: overpaidAmount5}
];
}
else
{
myData =
[
{Line:"1", ServiceCode: cpt1, BilledCharge: charge1, Paid: majorPaid1, OverpaidAmount: overpaidAmount1},
{Line:"2", ServiceCode: cpt2, BilledCharge: charge2, Paid: majorPaid2, OverpaidAmount: overpaidAmount2},
{Line:"3", ServiceCode: cpt3, BilledCharge: charge3, Paid: majorPaid3, OverpaidAmount: overpaidAmount3},
{Line:"4", ServiceCode: cpt4, BilledCharge: charge4, Paid: majorPaid4, OverpaidAmount: overpaidAmount4},
{Line:"5", ServiceCode: cpt5, BilledCharge: charge5, Paid: majorPaid5, OverpaidAmount: overpaidAmount5}
];
}
datagrid.dataProvider = new DataProvider(myData);
任何幫助表示讚賞。
此文檔可能有助於http://livedocs.adobe.com/flex/3/html/help.html?content=cell editor_8.html – Pan