field: 'actionId', title: "操作", formatter: function (value, row, index) { var isReadOnly = null; if(row.entryStatus == 50041002){ isReadOnly='disabled'; } return "<input type='button' class='l-btn l-btn-small' onclick='showBookEntry(" + value + "," + JSON.stringify(row) + "," + index + ")' value='查看 '/> "+ "<input type='button' class='l-btn l-btn-small' "+isReadOnly+" onclick='editorBookEntry(" + value + "," + JSON.stringify(row) + "," + index + ")' value='编辑 '/> "+ "<input type='button' class='l-btn l-btn-small' onclick='historyBookEntry(" + value + "," + JSON.stringify(row) + "," + index + ")' value='变更记录'/>" }让disable的input框变灰色
时间: 2024-03-04 22:49:26 浏览: 265
您可以在isReadOnly='disabled'之后添加style='background-color: #f2f2f2;',这样就可以将disabled的input框变成灰色了。修改后的代码如下:
```
field: 'actionId',
title: "操作",
formatter: function (value, row, index) {
var isReadOnly = null;
if(row.entryStatus == 50041002){
isReadOnly='disabled';
}
return "<input type='button' class='l-btn l-btn-small' onclick='showBookEntry(" + value + "," + JSON.stringify(row) + "," + index + ")' value='查看 '/> "+
"<input type='button' class='l-btn l-btn-small' "+isReadOnly+" style='background-color: #f2f2f2;' onclick='editorBookEntry(" + value + "," + JSON.stringify(row) + "," + index + ")' value='编辑 '/> "+
"<input type='button' class='l-btn l-btn-small' onclick='historyBookEntry(" + value + "," + JSON.stringify(row) + "," + index + ")' value='变更记录'/>";
}
```
阅读全文