var length = grid.store._arrayOfAllItems.length;//循环遍历合同信息,并修改合同信息(修改状态、支数和重量)for(var i = 0;ilength;i++){//取得主键 var id = grid.store.getValue(grid.getItem(i),"id");//取得合同信息
var length = grid.store._arrayOfAllItems.length; //循环遍历合同信息,并修改合同信息(修改状态、支数和重量) for(var i = 0;i<length;i++){ //取得主键 var id = grid.store.getValue(grid.getItem(i),"id"); //取得合同信息 var conId = grid.store.getValue(grid.getItem(i),"constractId"); var materialNumber = grid.store.getValue(grid.getItem(i),"materialNumber"); var materialWeight = grid.store.getValue(grid.getItem(i),"materialWeight"); var contract ='{"id":"'+id+'","constractId":"'+conId+'","materialNumber":"'+materialNumber+'","materialWeight":"'+materialWeight+'"}'; //将合同转换为object对象 var strObj = Json.parse(contract, true); //将object转换为json对象 var strJson = Json.stringify(strObj);