集成 jqGrid 和 JavaScriptMVC
有没有人尝试过集成jqGrid和JavaScriptMVC,特别是使用JMVC的模型封装来检索数据而不是jqGrid?
添加 jqGrid 作为插件似乎很容易,但尝试将其合并到 MVC 模型中一开始并不容易。
Has anyone tried to integrate jqGrid and JavaScriptMVC, particularly using JMVC's model encapsulation to retrieve data instead of jqGrid?
It seems easy to add jqGrid as a plugin, but trying to incorporate it into the MVC model hasn't been easy at the outset.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我设置了一个控制器,将网格添加到视图(通常是 DIV),并提供使用网格的功能,例如“setData”、“redraw”等。
我保留对分配网格的元素的引用所以我可以做一些事情,例如:
需要做一些工作才能使其全部正常工作(即必须做一些事情才能根据已排序的列正确设置排序图标,必须构建一个新的'每次我想设置时 localreader' 对象网格上的新数据等)。
所以这是可能的,但需要一些工作,特别是如果您想控制获取数据并将其提供给网格(网格通常要么想要自己进行服务器端调用,要么在您第一次构建它时需要一组数据,我的情况是我想自己获取数据,然后在网格构建后填充它)。
I setup a controller that has adds the grid to the view (usually to DIV) and provides functions for working with the grid such as "setData", "redraw", etc.
I keep a reference to the element that I assigned the grid to so I can do stuff such as:
It took a bit of work to get it all working properly (i.e. had to do some stuff to get the sort icons to be set properly based on the column that was sorted, had to build a new 'localreader' object each time I wanted to set new data on the grid, etc).
So it's possible but will take some work especially if you want to control fetching data and giving it to the grid (the grid generally either wants to make server-side calls itself or it wants an array of data when you first build it, my situation was that I want to fetch data myself and then populate it, after the grid is built).