获取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">以上就是本文的全部内容,希望对大家有所帮助!

相关文章

前言 做过web项目开发的人对layer弹层组件肯定不陌生,作为l...
前言 前端表单校验是过滤无效数据、假数据、有毒数据的第一步...
前言 图片上传是web项目常见的需求,我基于之前的博客的代码...
前言 导出Excel文件这个功能,通常都是在后端实现返回前端一...
前言 众所周知,js是单线程的,从上往下,从左往右依次执行,...
前言 项目开发中,我们可能会碰到这样的需求:select标签,禁...