Grid背景色设置
'Background-Color:' + if(types='0', 'white',
if(types='1', 'red',
if(types='2', 'yellow',
if(types='3', 'skyblue',
if(types='4', 'sandybrown',
if(types='5', 'pink', 'white'))))))
Grid行字体颜色设置
'color:'+
if(IsSeller = 'Y','Red',
'Black')
控制代码:
//采购记录待使用确认 - 全选
function uf_selectAll(){
tmpRec = 0;
tmpNum = 0;
tmpTaxAmount = 0;
tmpCostAmt = 0;
if (grid1.dataset.recordCount > 0){
for (var i = 0;i < grid1.dataset.recordCount;i++){
grid1.dataset.setValueAt(i, "IsSeller", 'Y');
tmpRec++;
tmpNum += grid1.dataset.getValueAt(i,"Num");
tmpTaxAmount += grid1.dataset.getValueAt(i,"TaxAmount");
tmpCostAmt += grid1.dataset.getValueAt(i,"TaxAmount");
}
dsRkmx.update();
dsRkmx.updateGrid();
}
label18.setHTML(tmpRec.toString());
label19.setHTML(tmpNum.toLocaleString());
label20.setHTML(tmpTaxAmount.toLocaleString());
label21.setHTML(tmpCostAmt.toLocaleString());
}
//采购记录待使用确认 - 全不选
function uf_selectNone(){
tmpRec = 0;
tmpNum = 0;
tmpTaxAmount = 0;
tmpCostAmt = 0;
if (grid1.dataset.recordCount > 0){
for (var i = 0;i < grid1.dataset.recordCount;i++){
grid1.dataset.setValueAt(i, "IsSeller", 'N');
}
dsRkmx.update();
dsRkmx.updateGrid();
}
label18.setHTML(tmpRec.toString());
label19.setHTML(tmpNum.toLocaleString());
label20.setHTML(tmpTaxAmount.toLocaleString());
label21.setHTML(tmpCostAmt.toLocaleString());
}
//采购记录待使用确认 - 返选
function uf_selected(){
tmpRec = 0;
tmpNum = 0;
tmpTaxAmount = 0;
tmpCostAmt = 0;
if (grid1.dataset.recordCount > 0){
for (var i = 0;i < grid1.dataset.recordCount;i++){
if(grid1.dataset.getValueAt(i,"IsSeller") =="Y"){
grid1.dataset.setValueAt(i, "IsSeller", 'N');
}else{
grid1.dataset.setValueAt(i, "IsSeller", 'Y');
tmpRec++;
tmpNum += grid1.dataset.getValueAt(i,"Num");
tmpTaxAmount += grid1.dataset.getValueAt(i,"TaxAmount");
tmpCostAmt += grid1.dataset.getValueAt(i,"TaxAmount");
}
}
dsRkmx.update();
dsRkmx.updateGrid();
}
label18.setHTML(tmpRec.toString());
label19.setHTML(tmpNum.toLocaleString());
label20.setHTML(tmpTaxAmount.toLocaleString());
label21.setHTML(tmpCostAmt.toLocaleString());
}
//采购记录待使用确认 - 双击选择
function uf_DbClieck(){
dsRkmx.edit();
if(dsRkmx.field("IsSeller").value == "Y"){
tmpRec -= 1;
tmpNum -= dsRkmx.field("Num").value;
tmpTaxAmount -= dsRkmx.field("TaxAmount").value;
tmpCostAmt -= dsRkmx.field("TaxAmount").value;
dsRkmx.field("IsSeller").value = "N";
}else{
tmpRec += 1;
tmpNum += dsRkmx.field("Num").value;
tmpTaxAmount += dsRkmx.field("TaxAmount").value;
tmpCostAmt += dsRkmx.field("TaxAmount").value;
dsRkmx.field("IsSeller").value = "Y";
}
dsRkmx.update();
dsRkmx.updateGrid();
label18.setHTML(tmpRec.toString());
label19.setHTML(tmpNum.toLocaleString());
label20.setHTML(tmpTaxAmount.toLocaleString());
label21.setHTML(tmpCostAmt.toLocaleString());
}