gird formula处理插件

new Ext.grid.EditorGridPanel({
		region:"center",store:store,stripeRows:true,frame:true,clicksToEdit:1,
		plugins:new Ext.ux.EditorGridRenderer({
			formulas:{
				total : "Math.max(baseWage+careerWage+addWage+salesWage+ssubsidy+otherAdd-absentWage-reduce-(comInsurance==\"1\"?myInsurance:0),0).round(2)",
				taxWage : "total.stepCompile(_jsonClass['cls_'+regionId].taxClass).round(2)",
				salesWage : {fm:setSalesWage},
				wage : "(total-taxWage).round(2)",
				isGranted : {fm:checkSales},
				baseWage : {fm:setBaseWage},
				careerWage : {fm:setCareerWage},
				workDaysBalance : {fn:setBalance},
				addBalance : {fn:setBalance},
				addWage : {fm:setModulusWage},
				absentBalance : {fn:setBalance},
				absentWage : {fm:setModulusWage},
				ssubsidy : {fm:setSSubsidy},
				taxCom : "comInsurance=='1'?0:((total-taxWage)*0.0555).round(2)",
				laborFee : "total>=800 && workDaysBalance>=28 ? 17:0",
				reduce : {fm:setReduce},
				otherAdd : {fm:setIncentive}
			}
		}), 

 

 

 

 

 

formulas:{columnName:expression<string>,....} 

 

formulas:{columnName:{fm:function,fn:function}} 
//fm是公式函数...fn是方法函数..也可以这么写..
formulas:{columnName:function}

 

 

你可能感兴趣的:(ext)