tags:

views:

1590

answers:

5

I have a jqGrid with multiselect:true. In a click event of a button I try to retrieve the ids like:

var ids = $('#myGrid').jqGrid('getGridParam', 'selarrrow');

However I only get ids to be filled with something if I select the top checkbox in the header. If I do not select that one in the header but select several checkboxes in the column ids has no selected ids in it. How to overcome this?

sellarrrow is according to this example written correctly: http://www.trirand.com/blog/jqgrid/jqgrid.html, select Advanced, Multiselect example.

A: 

I am using below code to retrieve randomly selected rows and its working fine ..

var selArr = $("#my_grid").getGridParam("selarrrow");

Nav Ali
A: 

Turned out to be a defaulting setup where this was set:

beforeSelectRow: function(rowid, e) { return false; },

Setting that to true gave me back the power.

Nyla Pareska
A: 

I do have the same issue with row selection, but I do not see the above line of code in my page. beforeSelectRow: function(rowid, e) { return false; },. Please advise.

NEW2JQ
A: 

if i put $('#id ').getGridParam('selectarrow') instead of $('# ').JQgrid('getGridParam','selectarrow') it works

deepti
A: 

HI add beforeSelectRow: cancelRowClickSelection,

property to jq grid. function defenition is given below. It is working perfectly.

function cancelRowClickSelection(rowid, e) { var target=e.originalTarget; var str=target.innerHTML; if(target.classList!=null && target.classList!="undefined" && target.classList[0]!=null && target.classList[0]!="undefined") { if(target.classList[0]=="cbox") { return true; } } if(str.indexOf("input")!=-1 || str.indexOf("INPUT")!=-1) { return true; } return false; }

subin sebastian