dorado datagrid对固定行进行操作

var value;//金额
var xs;//系数
var totalval=0;//总计金额
var totalval2=0;//折后总计金额
var val=0;
var val2=0;
var model = view.get("#datagridldxfgl").get("itemModel");
var total = model.getItemCount();//获取总行数
var item = view.get("#datagridldxfgl").getCurrentItem();//获取行的对象
var index = model.getItemIndex(item);//获取本行索引
if(index!=0){
value = model.getItemAt(index).get("je");
xs = model.getItemAt(index).get("zsxs");
model.getItemAt(index).set("zshje",parseFloat(value*xs).toFixed(2));
for(var i = 1; i
val = model.getItemAt(i).get("je");
if(val!="" && val!=null){
totalval=(parseFloat(totalval)+parseFloat(val)).toFixed(2);
}
val2 =  model.getItemAt(i).get("zshje");
if(val2!="" && val2!=null){
totalval2=(parseFloat(totalval2)+parseFloat(val2)).toFixed(2);
}
}
model.getItemAt(0).set("je",totalval);//给总金额赋值
model.getItemAt(0).set("zshje",totalval2);//给折算后总金额赋值
//获得表1中的优质流动资产折算后金额

var Grid1c0 = view.get("#datagridldxfgl").get("itemModel").getItemAt(0).get("zshje");
var Grid2c0 = view.get("#datagridldxfgl2").get("itemModel").getItemAt(0).get("zshje");
if(Grid1c0!=0 && Grid1c0!=null && Grid2c0!=0 && Grid2c0!=null){
view.get("#datagridldxfgl2").get("itemModel").getItemAt(10).set("zshje",parseFloat(Grid1c0/Grid2c0).toFixed(2));
}
}


你可能感兴趣的:(dorado datagrid对固定行进行操作)