jqgrid单击本地数据列排序(仅限客户端)在网格刷新时擦除用户数据
我有一个由 JSON 响应(MVC3 控制器)填充的网格,该网格具有用于网格标题等一些附加数据的 userData 组件。所有这些都工作得很好。我最近将网格的数据加载切换为“loadonce:true”,因为在处理更大的网格结果集时,我想要客户端排序和过滤。一切都很好。但是,令我惊讶的是,当我第一次单击任何列进行排序时,用户数据被擦除了。如果我关闭loadonce,userData就可以了,但它当然每次都会返回到服务器。使用 userData 的项目在 gridcomplete 上触发,现在在排序后返回“未定义”(可能还有重新加载网格的任何内容)。有什么想法为什么会发生这种情况吗?哦,是的,我还注意到,单击列排序会消除任何多重选择(可能与同一个罪魁祸首有关?)。
谢谢,
马克
I have a grid that is populated by a JSON response (MVC3 controller) that has a userData component for some additional data for grid captions, etc. All that works just fine. I recently switched the the grid's data loading to "loadonce: true" as in working with larger grid results sets, I wanted client-side sorting and filtering. All that works good. BUT, I was surprised that the userData got wiped the first time I clicked any column for sorting. If I turn off loadonce, userData is fine, but it is of course going back to the server each time. The items that make use of the userData fire on gridcomplete and are now coming back "undefined" after a sort (and probably anything that reloads the grid). Any thoughts why this might be happening? Oh yeah, I also noticed that clicking a column sort wiped out any multiselections (perhaps related to the same culprit?).
Thanks,
Mark
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是对的。我的+1。这是一个 jqGrid 错误。 jqGrid 4.1.2 的文件 grid.base.js 的第 1527 行或 的 1532 之后
jquery.jqGrid.src.js
(您可以从 此处)应该添加以下行它将解决问题。我发布了相应的错误报告 此处。
You are right. +1 from me. It's a jqGrid bug. Inside of internal
addLocalData
method after the line 1527 of the file grid.base.js of jqGrid 4.1.2 or after the 1532 ofjquery.jqGrid.src.js
(you can get modified version from here) one should add the following lineIt will fix the problem. I posted the corresponding bug report here.