Is it possible to turn off the row selection feature on Flexigrid? It's somewhat annoying when you haven't implemented anything that makes use of the selection.
3 Answers
Unfortunately Mr Flibble's accepted answer does not stop all selection capability, it merely restricts it to one row. To disable it completely, add a new property to the $.extend block (around line 20)
// apply default properties
p = $.extend({
<SNIP>
onSubmit: false, // using a custom populate function
disableSelect: true
Then in the .click section of the row (around line 754) add a check for the property
$(this)
.click(
function (e)
{
var obj = (e.target || e.srcElement); if (obj.href || obj.type) return true;
if (p.disableSelect) return true;
$(this).toggleClass('trSelected');
if (p.singleSelect) $(this).siblings().removeClass('trSelected');
}
)

- 2,789
- 1
- 21
- 19
-
Is it possible to turn off the row selection feature on Flexigrid? Yes this is the solution. Good job Flapper! +1 – Brant Messenger Nov 02 '10 at 19:49
Turns out you need to change the singleSelect property to true.
singleSelect: true

- 26,564
- 23
- 69
- 100
-
This disables *multi-row* selection. Flapper's answer below disables *all* selection. – Matt Mitchell May 10 '11 at 07:19
-
1Oddly enough, this disables selection as of the most recent version. And, oddly enough, I'm looking for both options. – John Baughman Aug 17 '12 at 22:06
-
I know this thread is a bit old but I came upon it looking for the same thing. The singleSelect didn't work for me as I didn't want to be able to select any row. I found that I could remove any row selection with a single line of code:
$('.grid tr').unbind('click');
This a course removes all bindings on the table row so if you needed the binding you won't have it unless you rebind later but I needed to remove any and all row selection on my table. I didn't need to touch the flexigrid code to do so which I liked a bit more than previous answers.

- 757
- 1
- 8
- 24