|
发表于 2015-4-20 09:23:22
|
显示全部楼层
下面代码供你参考,如果列的类型是text,设置ro可能会不生效的,setTimeout是必须要的:
- var data = justep.xbl('dataDetail');
- var total = data.getTotal();
- var grid = justep.xbl('grdDetail');
- for ( var i = 0; i < total; i++) {
- var rowid = data.getID(i);
- if (data.getValue("fProClassificationCode", rowid) == "Z6") {
- if (data.getValue("fInvCode", rowid) == "Z602") {
- grid.grid.setCellExcellType(rowid, 12, "ro");
- grid.grid.setCellExcellType(rowid, 13, "ro");
- grid.grid.setCellExcellType(rowid, 14, "ro");
- grid.grid.setCellExcellType(rowid, 15, "ed");
- grid.grid.setCellTextStyle(rowid, 15,
- "background-color: yellow");
- }
- } else {
- grid.grid.setCellExcellType(rowid, 12, "ed");
- grid.grid.setCellExcellType(rowid, 13, "ed");
- grid.grid.setCellExcellType(rowid, 14, "ed");
- grid.grid.setCellExcellType(rowid, 15, "ro");
- grid.grid.setCellTextStyle(rowid, 12, "background-color: yellow");
- grid.grid.setCellTextStyle(rowid, 13, "background-color: yellow");
- grid.grid.setCellTextStyle(rowid, 14, "background-color: yellow");
- }
- }
- setTimeout(function() {
- var grid = justep.xbl('grdDetail');
- grid.grid.setSizes();
- }, 200);
复制代码 |
|