<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.f2er.com/js/44020.html