jqGrid动态rowNum不显示返回的行 [英] jqGrid dynamic rowNum not displaying returned rows

查看:221
本文介绍了jqGrid动态rowNum不显示返回的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的PHP应用程序作为行限制,排序等的权限",这意味着它将使用AJAX响应输出此信息,并更新jqGrid的设置以进行匹配.

I have my PHP application as the "authority" for row limiting, sorting, etc., meaning it outputs this information with the AJAX response and I update jqGrid's settings to match.

问题:

我首先加载网格省略限制,页面等,以便使用PHP中定义的默认值. AJAX请求触发,我得到回应.它会返回价值27行的数据,并且rowNum的上限为"50".

I first load the grid omitting limit, page, etc. in order to use the defaults defined in PHP. The AJAX request fires and I get my response. It's returning 27 rows worth of data and a limit for rowNum of "50".

在loadComplete内,我使用grid.setGridParam来更新网格设置,并使用grid.sortGrid(w/reload = false)来更新某些视觉效果,并且一切正常……除了它仅显示返回的27行中的20行.

Within loadComplete I use grid.setGridParam to update the grid settings and use grid.sortGrid (w/ reload=false) to update some of the visuals and everything works... except it's only displaying 20 of the 27 rows returned.

我已经使用控制台日志来验证从调用中返回了27行,并使用了元素查看器来验证仅将20个表行添加到了DOM中.有证据表明,这不仅仅是显示问题(某些高度设置可以将最后7位截止),而且看起来jqGrid的逻辑正在将其截止.

I've used console logs to verify that 27 rows are returned from the call and an element viewer to verify that only 20 table rows were added to the DOM. This is evidence that it's not just a display issue (some height setting cutting the last 7 off) but it looks like jqGrid's logic is cutting them off.

推荐答案

在完成我的问题之前就解决了它,但会在其他人遇到的情况下分享.

Solved it before even finishing my question, but will share in case anyone else runs into this.

尽管文档声称"loadComplete"在每个服务器请求之后立即触发",但看起来至少在触发之前执行了一些处理/渲染.我将setGridParam和sortGrid代码移到了"beforeProcessing"中,看来已经解决了这个问题.

Though the docs claim "loadComplete" fires "immediately after every server request", it looks like at least some processing/rendering is performed before it fires. I moved the setGridParam and sortGrid code into "beforeProcessing" instead and it seems to have solved the problem.

这篇关于jqGrid动态rowNum不显示返回的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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