只在jqGrid中显示特定记录?

发布于 2024-11-14 23:28:19 字数 60 浏览 3 评论 0原文

如何只在jqGrid中显示特定记录?

例如,用户登录后仅显示选择的记录 根据登录的用户名?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淑女气质 2024-11-21 23:28:19

奥列格对欺骗问题的回答是正确的,您通常应该根据请求限制从服务器发送到页面的数据。

还可以使用网格 loadComplete 方法做出决策:

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");
         }
      }
   }
}

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");
         }
      }
   }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文