Gets the data for the row selected in the Jqgrid
How to get the data for the row selected in Jqgrid.
Below you can get the ID of the selection row, if you select multiple rows, the following ID is the ID of the last selected row:
var id=$ (' #gridTable '). Jqgrid (' Getgridparam ', ' selrow ');
If you want to get an ID that selects multiple rows, then these IDs are encapsulated into an array of IDs, which can be used as follows:
var ids=$ (' #gridTable '). Jqgrid (' Getgridparam ', ' selarrrow ');
If you want to get the data for the selected row, just pass in the ROWID, as follows:
var RowData = $ ("#gridTable"). Jqgrid (' GetRowData ', rowId);
And this rowdata is an object, if you want to get the value of the property of the selected row for this object, such as the value of name, you need the following:
var rowname=rowdata.name;
Of course you have to have the name attribute for this object.
Application Examples:
var ids=$ ("#rightGrid9"). Jqgrid ("Getgridparam", "Selarrrow");
if (ids.length==1) {
var rowid=$ ("#rightGrid9"). Jqgrid ("Getgridparam", "Selrow");
$ ("#rightGrid9"). Pangrid ("Downlayer", {"rowID": rowID});
else{
alert ("You have not selected or selected as multiple rows of data and are not allowed to enter the next level");
}