jqgrid表格控件之编辑,删除时,将选中行的字段值POST传到后台,且可自定义其他传参字段值

本文档介绍了如何在使用jqgrid表格控件时,将编辑和删除操作时选中行的字段值及自定义参数通过POST方式发送到后台。通过查阅官方文档,了解到可以利用特定参数在操作前初始化传参,从而获取并封装选中行的值。示例代码以PHP为例,展示如何在编辑和删除操作中接收并处理这些数据。

1)解决问题,养成阅读官方文档的习惯,学会从文档中找到解决问题的办法

官方文档地址:http://www.trirand.com/jqgridwiki/doku.php?id=wiki:form_editing

2)问题:在是使用jqgrid表格控件时发现,编辑,删除操作时,后台post只接受到 id , opr两个值,没有收到所选行的值

3)说明:id属于表格自定义选中行的id,opr属于操作:删除就是‘del’,只收到这两个值是不够的,我们想要对选中行的数据库数据进行操作就需要将所选行连同默认的这两个值一起POST传到后台

在官方文档中有这么一类参数:

serializeDelData If set this event can serialize the data passed to the ajax request when we save a form data. The function should return the serialized data. This event can be used when a custom data should be passed to the server - e.g - JSON string, XML string and etc. To this event is passed the data which will be posted to the server.
serializeEditData If set this event can serialize the data passed to the ajax request when we save a form data. The function
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值