How to get a column from selected row from jqGrid?
I am using JQGrid in my asp. And i enabled the feature multiselect:true
.
How to get a column from selected row from jqGrid?
var rowRule = jQuery("#list").getGridParam('selarrrow');
Using this index of row how can i get the first column of row is there any predefined method for this? If exist please let开发者_开发知识库 me know.
I tried this:
var grid = jQuery("#<%= JQGrid1.ClientID %>");
var rowKey = grid.getGridParam("selrow");
This is not working in classic asp
Thanks in advance. Vissu.P
jQuery("#list").getGridParam('selarrrow')
returns the list of rowids of selected rows. You can use getCell
method in the loop to get the contain of the column which you need from every selected row and place the contain in an array:
var selIds = grid.jqGrid('getGridParam','selarrrow'),
selText = [];
$.each(selIds,function() {
selText.push(grid.jqGrid('getCell',this,'name'));
});
See the demo here.
Your problem should not have anything to do with your server-side platform (Classic ASP, ASP.NET, etc), since you are using JavaScript to get the ID of the selected row. Try this instead to get the selected Row ID:
var grid = jQuery("#<%= JQGrid1.ClientID %>");
var rowKey = grid.jqGrid('GetGridParam', 'selrow');
精彩评论