tags:

views:

797

answers:

5

I am using a jqGrid with multiselect put on. That works but I have a side effect which I would like to get rid off. Whenever someone clicks on a row the checkbox also alters its checked state. I would like to leave that out.

I tried this:

onSelectRow: function(row) { return false; }

and setting

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

If I set this to false I get the desired behavior but then I also don't get any selected id's anymore via

jqGrid('getGridParam', 'selarrrow');

Anyone has an idea to fix this?

A: 

jqGrid is designed to work this way; do you have a good reason for not wanting to display the checkboxes?

Justin Ethier
I was already afraid of that. The usability team is convinced it's not correct behavior and want it the other way.
XIII
+2  A: 
$("#Grid_ID").jqGrid('hideCol', 'cb');

Add above line of code on gridComplete function

Dipesh
A: 

Hi, I have the same problem. Only, I do not want to hide the checkbox column. I want to be able to alter the checkbox only by clicking the checkbox not the rest of the row. I'm using inline-editing and whenever I want to change a value in a row it also change the status of the checkbox.

Is it possible to achieve this?

Regards Freddie

Fredrik Sjöqvist
This is possible - add the option multiboxonly:true to achieve this.
Byron Cobb
A: 

I was able to accomplish that by checking the column ID provided to the onSelect event handler. If it's any column other than the first, return false. I had to do it in a couple of event handlers in order to get the preferred behavior.

Rakesh Malik