views:

71

answers:

2

I'm using tinysort plugin on jQuery and it works great.

However I would like if there is an "unsort" option, to restore the default order of my elements.

Thanks

A: 

My advice would be output the index of your list items (or whatever) in a hidden span and then in your undo button sort on that.

Rob Stevenson-Leggett
A: 

I solved in this way:

var alphaOrder = defaultOrder.clone();

and then:

defaultOrder.remove(); alphaOrder.tsort("label").each(function(i){$(this)}); tagsDiv.append(alphaOrder);

and viceversa.

Patrick