微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

获取jqGrid中选择的行的数据

<p style="white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(51,51,51); padding-bottom: 0px; text-align: left; padding-top: 0px; font: 14px/25px 'Microsoft YaHei',微软雅黑,Arial,'Lucida Grande',Tahoma,sans-serif,'Helvetica Neue',Helvetica; padding-left: 0px; margin: 0px; orphans: 2; widows: 2; letter-spacing: normal; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-stretch: normal">下面可以获取选择一行的id,如果你选择多行,那下面的id是最后选择的行的id:


<p style="white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(51,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-stretch: normal"><span style="color: rgb(0,255); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; line-height: 1.5; padding-right: 0px">var id=$(‘#gridTable').jqgrid(‘getGridParam','selrow');


<p style="white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(51,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-stretch: normal">如果想要获取选择多行的id,那这些id便封装成一个id数组,那可以使用以下:


<p style="white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(51,255); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; line-height: 1.5; padding-right: 0px">var ids=$(‘#gridTable').jqgrid(‘getGridParam','selarrrow');


<p style="white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(51,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-stretch: normal">如果想获取选择的行的数据,只要传入rowId即可,如下:


<p style="white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(51,255); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; line-height: 1.5; padding-right: 0px">var rowData = $(“#gridTable”).jqgrid(‘getRowData',rowId);


<p style="white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(51,255); text-indent: 0px; -webkit-text-stroke-width: 0px; font-stretch: normal">以上就是本文的全部内容,希望对大家有所帮助!

原文地址:https://www.jb51.cc/js/44020.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐