Add additional param to post data using jqGrid when adding new row with modal form(在使用模态表单添加新行时使用 jqGrid 添加其他参数以发布数据)
问题描述
当我以模态形式添加新记录时,我需要向 jqGrid 的 POST
数据添加额外的动态参数.
I need to add additional dynamic parameter to jqGrid's POST
data when I'm adding new record with modal form.
我试过了:
$('#table').setPostData({group: id});
$('#table').setPostDataItem('group', id);
$('#table').setGridParam('group', id);
什么都没解决.
推荐答案
你可以使用 的="nofollow noreferrer">editData 参数editGridRow 方法.在大多数情况下,您不直接使用 editGridRow,但使用导航器.在这种情况下,您可以将 editData 定义为部分prmEdit 或 prmAdd
的="nofollow noreferrer">navGrid:
you can use editData parameter of the editGridRow method. In the most cases you use editGridRow not directly, but using Navigator. In the case you can define editData as the part of prmEdit
or prmAdd
of the navGrid:
$('#table').jqGrid('navGrid','#pager',
{/*navGrid options*
本文标题为:在使用模态表单添加新行时使用 jqGrid 添加其他参数以发布数据


基础教程推荐
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- 直接将值设置为滑块 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01