Display specific records only in jqGrid?

二次信任 提交于 2019-12-25 00:44:17

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!