我正在研究一个数据网格,它从流程早期获得的变量中提取信息。我需要能够编辑 overpaidAmount 列。除了需要用户输入的列之外,我已经锁定了所有列,但是一旦他们添加了信息,我如何将其分配回变量?在网上到处找,找不到任何关于这个特定问题的东西。
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);
任何帮助表示赞赏。