This project is archived and is in readonly mode.

#573 open
Chris Ghormley

HtmlTable.Sort sort() method doesn't work with prepare flag

Reported by Chris Ghormley | May 19th, 2011 @ 12:24 AM

In this jsfiddle: http://jsfiddle.net/cDyjz/146/

I've set up a table to be sorted by the first column then by the
second column. I've used the "prepare" flag in the first call to sort():

myTable.sort(1,false,true);
myTable.sort(0,false,false);

I expect the first column to contain [ 1, 1, 1, 2, 2, 2 ] and the second column to contain [ a, b, c, a, b, c ].
The first column is sorted, tut the second column doesn't get sorted at all.

Then I edited the code to call sort with the "prepare" flag set to false, like this:

myTable.sort(1,false,false);
myTable.sort(0,false,false);

And it sorts as expected. You can see this in http://jsfiddle.net/cDyjz/147/

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

Pages