仅在jqGrid中显示特定记录? [英] Display specific records only in jqGrid?

查看:96
本文介绍了仅在jqGrid中显示特定记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何仅在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?

推荐答案

Oleg对dupe问题的回答是正确的,通常应基于请求限制从服务器发送到页面的数据.

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.

还可以使用grid loadComplete方法进行决策:

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

这篇关于仅在jqGrid中显示特定记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆