问题
How do I display specific records only in jqGrid?
For example, after a user login only select records will display according to the username that is logged in?
回答1:
Oleg's answer to the dupe question is right, you should typically limit the data you send to the page from the server based on the request.
It is also possible to make decisions using the grid loadComplete method:
loadComplete: function (data) {
if (data.rows.length > 0) {
for (var i = 0; i < data.rows.length; i++) {
if ([condition]) {
$("#" + data.rows[i].Id).css("display", "none");
}
}
}
}
来源:https://stackoverflow.com/questions/6295243/display-specific-records-only-in-jqgrid