jqGrid自定义编辑对话框 [英] jqGrid Custom Edit Dialog
问题描述
我正在使用jqGrid的应用程序.问题在于,应在行编辑时出现的编辑对话框必须具有特定的布局.因此,我希望通过ajax加载它,然后将数据手动发送回jqGrid.我在论坛上进行了很多搜索,但找不到如何执行此操作的示例.
I am working to an application that uses jqGrid. The problem is that the edit dialog that should appear at row edit must have a specific layout. So I would prefer to load it via ajax and then send the data back to jqGrid manually. I searched a lot on the forums but I could not find an example of how to do it.
因此,我只需要jqGrid即可用来自PHP脚本的自定义内容填充编辑对话框弹出窗口.
So, I just need jqGrid to fill the edit dialog pop-up with custom content from a PHP script.
更新:我的想法是我有一个表单生成器,用户可以在其中设置编辑字段的位置/宽度/高度/可见性...并且必须在编辑对话框中使用它.
UPDATE: THe idea is that I have a form generator, where the user sets the position/width/heigh/visibility of the edit fields... and this must be used in the edit dialog.
推荐答案
您可以使用addfunc
选项?id = wiki:navigator#parameters"rel =" nofollow noreferrer> navGrid .例如,如果定义了editfunc
,则代替 editGridRow jqGrid将被称为editfunc
,其中所选行的ID作为参数.
You can use editfunc
or addfunc
option of the navGrid. If for example editfunc
are defined then instead of editGridRow jqGrid will be called editfunc
with the id of selected row as the parameter.
Alternative you can use custom button (see this answer as an example).
To modify data in the table after ther custom edit dialog you can use setRowData function.
UPDATED: If you need just make some modification of layout of the edit dialog you can use beforeShowForm for th modifications.
这篇关于jqGrid自定义编辑对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!