This project is archived and is in readonly mode.

#550 open

Bug in HTMLTable.Select and it's docs - shiftForMultiSelect option not working

Reported by MajkD | March 27th, 2011 @ 07:06 PM | in (closed)

As in title - setting the shiftForMultiSelect to false doesn't make multiselect work without shift. Additionally, the docs say that this option defaults to false, while it's set to true in the code.
I've overcome this by changing line 1 of a private function _clickRow, which starts like this:

_clickRow: function(event, row){
   var selecting = (event.shift || event.meta || event.control) && this.options.shiftForMultiSelect;

I think, the author's intention was to make var selecting indicate if this event is supposed to add to existing selection (like shift+click should) or make a fresh one (like a normal click should).
Problem is, it only works when this.options.shiftForMultiSelect == true. If it's set to false, then every 'normal' click should act like it's a shift+click. Anyway, I changed it to:

_clickRow: function(event, row){
   var selecting = !this.options.shiftForMultiSelect || (event.shift || event.meta || event.control);

Now it works for me, but I'm not sure it's the best solution, as I have very limited experience with MooTools and it's even more limited with it's source code.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The MooTools Extensions

People watching this ticket