本文介绍了如何显示 jqGrid 中的所有行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jqGrid 公开了一个属性 rowNum,您可以在其中设置要为每个页面显示的行数.如何将网格设置为只显示所有行?

jqGrid exposes a property rowNum where you can set the number of rows to display for each page. How do you set the grid to just display ALL rows?

现在我只是将 rowNum 设置为非常高的值,例如 <%= int.MaxValue %> 但我想知道是否有更好的方法.

Right now I'm just setting the rowNum to something really high like <%= int.MaxValue %> but I'm wondering if there is a better way.

推荐答案


更新

不幸的是,这种行为在 jqGrid 3.6.3 中被破坏了.根据 这篇来自 Tony 的帖子:

Unfortunately this behavior was broken in jqGrid 3.6.3. According to this post from Tony:

是的,这是真的.原因是新推出的卷轴:1.以后我们会纠正这种行为.

所以 jqGrid 开发人员已经意识到了这个问题,并且显然计划在未来的版本中修复它.不幸的是,这篇文章是一年多前的……

So the jqGrid developers are aware of this problem and apparently are planning to fix it in a future release. Unfortunately this post was from over a year ago...

此时,我只能建议您将 rowNum 设置为一个非常大的数字,以模拟 -1 的行为.

At this time, all I can recommend is that you set rowNum to a very large number to simulate the behavior of -1.

您也可以尝试下面使用 rowNum: '' 的 whatispunk 解决方案.但是,我在包含本地数据的网格上进行了尝试(loadonce: true).当尝试对行进行排序时,所有网格的本地数据都会消失.所以这个解决方案似乎不适用于具有本地数据的网格,除非这个缺陷已经在 jqGrid 的更高版本中得到修复(我在 jqGrid 3.8.2 上测试过).如果您有任何反馈,请在下方发表评论!

You can also try whatispunk's solution below of using rowNum: ''. However, I tried this on a grid containing local data (loadonce: true). When attemping to sort the rows all of the grid's local data would disappear. So this solution does not seem to work for grids with local data, unless this defect has been fixed in a later version of jqGrid (I tested it on jqGrid 3.8.2). If you have feedback, please post a comment below!


更新 - 2014 年 4 月 16 日

根据 jqGrid 团队的说法,此问题现已修复:

我增加了对在寻呼机选择框上设置不同显示值的支持,包括全部 -1.

不过,我还没有机会进行测试以确认修复.估计这个变化会在 jqGrid 4.6.0 之后的下一个版本中.

I have not had a chance to test to confirm the fix, though. Presumably this change will be in the next release after jqGrid 4.6.0.

这篇关于如何显示 jqGrid 中的所有行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 07:36
查看更多