我在jqgrid中隐藏我的按钮时出现问题,这是我的代码
{name: 'FitaCorForApproval', index: 'FitaCorForApproval', width: 75,
formatter: function (cellvalue, options, rowObject) {
return '<input type="button" id="hidebuttonID" style ="width: 75px"
value="For Approval" onclick="clickme(' + options.rowId + ')" />'
}
感谢
答案 0 :(得分:1)
将其添加到格式化程序函数
formatter: function (cellvalue, options, rowObject) {
var showStyle= '';
if(!cellvalue)
{
showStyle="display:none";
}
return '<input type="button" id="hidebuttonID" style ="width: 75px '+showStyle+'"
value="For Approval" onclick="clickme(' + options.rowId + ')" />'
}