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 15:49:26 浏览: 301
您可以在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='变更记录'/>";
}
```
阅读全文
相关推荐


















columns: [{ checkbox: true }, { field : 'indexId', title : '指标id', visible: false }, { field : 'indexName', title : '指标名称', }, { field : 'relationChar', title : '关系符号', }, { field : 'yearIndex', title : '年度指标', }, { field : 'feedbackTime', title : '反馈周期', }, { field : 'statisticsPattern', title : '统计方式', }, { field : 'measurementUnit', title : '计量单位', }, { field : 'complete', title : '完成度', }, { field : 'progress', title : '反馈进度' }, { field : 'planId', title : '计划表id', visible: false }, { field : 'indexStatus', title : '指标状态', visible: false }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('编辑 '); actions.push('反馈记录'); actions.push('删除'); return actions.join(''); } }]帮我在progress列中写一个formatter:方法要求是如果该行中planStatus值等于1这用绿色低框白字样式显示progress值,如果等于等于1这用红色低框白字样式显示progress值

