9

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.

alt text

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Mr. Flibble
  • 26,564
  • 23
  • 69
  • 100

3 Answers3

8

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');
 }
)
Flapper
  • 2,789
  • 1
  • 21
  • 19
7

Turns out you need to change the singleSelect property to true.

singleSelect: true
Mr. Flibble
  • 26,564
  • 23
  • 69
  • 100
1

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.

Micah Montoya
  • 757
  • 1
  • 8
  • 24