如何使用jqGrid中的自定义数据打开像表单一样的编辑?(How to open Edit like form using custom data in jqGrid?)

编程入门 行业动态 更新时间:2024-10-13 16:15:43
如何使用jqGrid中的自定义数据打开像表单一样的编辑?(How to open Edit like form using custom data in jqGrid?)

我在很多页面上使用jqGrid,但是在一些不使用jqgrid的页面上我想显示Edit之类的形式以保持外观和感觉的一致性。

这个帖子谈论类似的东西,但那些页面有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.

最满意答案

因为在jqGrid的一部分中的表单编辑我会建议你,就像你已经在你的问题中提到的那样,创建一个隐藏的jqGrid来使用表单editGridRow方法。 可以使用data参数来填充网格的数据,并且网格应该具有datatype:'local' 。 至少像colModel , colNames等结构。 为了更加确定您的代码将继续在下一版本的jqGrid中工作,创建隐藏网格更好,因为创建一些虚拟结构。

所以主要的问题是“如何创建非模态的添加/编辑/视图表单?”。 为此,您可以使用以下添加/编辑/查看选项

jqModal:false, afterShowForm:function(){ $("#lui_"+grid[0].id).hide(); // hide overlay like "#lui_list" }

grid是你的grid / table的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 of data parameter and the grid should has datatype:'local'. At least the structures like colModel, 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

jqModal:false, afterShowForm:function(){ $("#lui_"+grid[0].id).hide(); // hide overlay like "#lui_list" }

where grid is jQuery wrapper of your grid/table: var grid = $("#list").

更多推荐

本文发布于:2023-08-02 03:39:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1368745.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   表单   如何使用   编辑   数据

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!