I am using a JQGrid, and have designed the grid such that the first column is a checkbox. I am using the property of multiselect:true
, and I am not writing any code other than this to get the checkboxes. How do I fetch the values from the rows where the checkboxes are checked?
Asked
Active
Viewed 979 times
0

DisplayName
- 3,093
- 5
- 35
- 42

Akshar A K
- 392
- 5
- 14
- 23
1 Answers
3
To get the selected rows, use:
var selected = $("#tableid").jqGrid('getGridParam', 'selarrrow');
selected
will be set to an array of IDs of the selected rows.
To get column values from the rows, use the getCell
method. See How to get the selected row id in javascript?
-
Thank you for the reply... am getting the ids in a comma separated array. what if i want to get the 1st column values in the same way? – Akshar A K Apr 16 '13 at 14:06
-
But that is returning me only 1 value. if i have 5 columns selected in multiselect only last value is shown. But i need all the values of the corresponding checkbox selected. – Akshar A K Apr 16 '13 at 14:58
-
You need to iterate over the array and do what you want with each row. – Barmar Apr 16 '13 at 15:01