dorado 重写foot的统计数据

ajax请求获取到数据后.

通过ajax的 onSuccess事件 .

然后获取到列,根据列将相应数据填进去.

 

 

var cols = view.get("#dgRequestMoney").get("dataColumns");

var colMap = $map({}) ;

 

if(cols && cols.length>0){

 

for(var i=0;i<cols.length;i++){

colMap.put(i,cols[i].get("name")) ;

}

 

console.log(colMap);

var tds = $(view.get("#dgRequestMoney").getDom()).find(".footer-table tbody td");

if(tds){

    tds.each(function(i){

if(colMap.get(i) =="operate"){

alert("operate:");

$(this).find("div:first").html("合计") ;

}else if(colMap.get(i) =="requestMoney"){

//$(this).find("div:first").html(arg.result.requestMoney==null?"0.00":dorado.util.Common.formatFloat(arg.result.requestMoney, "#,##0.00")) ;

$(this).find("div:first").html(arg.result.requestMoney==null?"0":dorado.util.Common.formatFloat(arg.result.requestMoney, "#,##0")) ;

}else if(colMap.get(i) =="taobaoOrderNum"){

$(this).find("div:first").html(arg.result.taobaoOrderNum==null?"0":dorado.util.Common.formatFloat(arg.result.taobaoOrderNum, "#,##0")) ;

}elseif(colMap.get(i)=="taobaoOrderMoney"){

$(this).find("div:first").html(arg.result.taobaoOrderMoney==null?"0.00":dorado.util.Common.formatFloat(arg.result.taobaoOrderMoney, "#,##0.00")) ;

}

});

}

}

猜你喜欢

转载自fengbin2005.iteye.com/blog/2371660