The simplest way to implement your requirements is the usage of rowattr
to disable the rows having Status
equal to -1.
The demo uses the free jqGrid 4.10.0 and the results on selection of all rows looks like on the picture below:
It uses the following rowattr
:
rowattr: function (rd) {
if (rd.closed) {
return {
"class": $(this).jqGrid("getGuiStyles", "states.disabled")
};
}
}
The code use closed
column instead of Status
column and the input values of the demo are boolean instead of numeric or strings in your case. You can easy modify the above code to your purpose.
In case of using old jqGrid 4.5.2 you can modify the above code to
rowattr: function (rd) {
if (rd.closed) {
return {
"class": "ui-state-disabled ui-jqgrid-disablePointerEvents"
};
}
}
and define CSS class ui-jqgrid-disablePointerEvents
as the following:
.ui-jqgrid-disablePointerEvents {
pointer-events: none;
}
The demo uses jqGrid 4.5.2 and it works too.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…