Hi you can get selected row by using the jqGrid
api
$.subscribe('delete', function(event,data) {
var rowid = $("#gridedittable").jqGrid(‘getGridParam’,'selrow');
$("#gridedittable").jqGrid(‘delRowData’,row_id);
}
This assumed you set the multiselect
param to false
.
For multiselect
, you have to use the option selarrrow
instead.
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options
And the grid setting should be like
<s:url var="remoteurl" action="jsontable"/>
<sjg:grid
id="gridtable"
caption="Customer Examples"
dataType="json"
href="%{remoteurl}"
pager="true"
gridModel="gridModel"
rowList="10,15,20"
rowNum="15"
rownumbers="true"
>
<sjg:gridColumn name="id" index="id" title="ID" key="true" sortable="false"/>
<sjg:gridColumn name="name" index="name" title="Name" sortable="true"/>
<sjg:gridColumn name="country" index="country" title="Country" sortable="false"/>
<sjg:gridColumn name="city" index="city" title="City" sortable="false"/>
<sjg:gridColumn name="creditLimit" index="creditLimit" title="Credit Limit" formatter="currency" sortable="false"/>
</sjg:grid>