如何在jqGrid中使用自定义数据打开类似表单的编辑?
我在很多页面上使用 jqGrid,但在某些未使用 jqgrid 的页面上,我想显示类似编辑的表单以保持外观和感觉的一致性。
此线程讨论了类似的东西,但这些页面有 jqgrid 表。
基本上,我想知道是否可以使用自定义行数据打开 jqGrid 添加/编辑/查看表单(无需定义完整表)?此外,由于这些表单位于新页面上,我想将它们显示为常规表单,而不是模态表单。
编辑:
我看到的一种可能性:我可以创建一个虚拟表并将其隐藏并生成表单,但这会以模式打开表单,我猜。最后一个选项可能是将 jqGrid css 应用到我的表单中。
I'm using jqGrid on lot of pages, but on some pages, which are not using jqgrid I want to show Edit like form to maintain look and feel consistency.
This thread talks about something similar but those pages have jqgrid table.
Basically, I'm wondering if its possible to open jqGrid add/edit/view form (without defining full table) using my custom row data? Additionally, since these forms are on new pages, I want to show them as a regular form, not in modal.
Edit:
One possibility I see : I can create a dummy table and hide it and generate form but this would open form in a modal, I guess. Last option could be applying jqGrid css to my forms.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因为表单编辑是 jqGrid 的一部分,所以我建议您,就像您在问题中已经提到的那样,创建一个隐藏的 jqGrid 来使用表单
editGridRow
方法。网格的数据可以根据data
参数来填充,并且网格应该具有datatype:'local'
。至少像colModel
、colNames
等结构。为了更确定您的代码将在 jqGrid 的下一个版本中继续工作,创建隐藏网格比创建一些虚拟结构更好。所以主要问题是“如何创建非模式添加/编辑/查看表单?”。为此,您可以使用以下添加/编辑/查看选项
,其中
grid
是网格/表的 jQuery 包装器:var grid = $("#list")
。Because the form editing in a part of jqGrid I would recommend you, like you already mention in your question, to create a hidden jqGrid to use form
editGridRow
method. The data of the grid can be filled with respect ofdata
parameter and the grid should hasdatatype:'local'
. At least the structures likecolModel
,colNames
and so on. To be more sure that your code will continue work in the next version of jqGrid creating a hidden grid is better as creating some dummy structures.So the main question is "How to create add/edit/view form which are not modal?". To do this you can use the following Add/Edit/View options
where
grid
is jQuery wrapper of your grid/table:var grid = $("#list")
.