Griddle icon indicating copy to clipboard operation
Griddle copied to clipboard

Grid does not sort properly for the 10th+ rows

Open roessera opened this issue 10 years ago • 3 comments

To be brief, here's some data:

{"visible": true, "order":"1" },
{"visible": true, "order":"3" }, {"visible": true, "order":"4" },
{"visible": true, "order":"5" }, {"visible": true, "order":"6" }, {"visible": true, "order":"7" }, {"visible": true, "order":"8" }, {"visible": true, "order":"9" }, {"visible": true, "order":"10"}, {"visible": true, "order":"11"}

Upon rendering, column #11 gets rendered between column #1 & column#2.

roessera avatar Feb 12 '16 21:02 roessera

Since you have quotes around those, JavaScript sees them as a string. Could you try to take off the quotes from the numeric values to see if that resolves the issue?

blkmutt avatar Feb 13 '16 13:02 blkmutt

Thanks, works.

Not sure if this is overkill, but would it possible to add a parseInt(x) / Number(x) upon sorting?

roessera avatar Feb 19 '16 19:02 roessera

The new Griddle lets you define sort types on the columns and provide custom sort functions as well.

I could totally be mistaken but necessarily sure that we want parseInt / etc baked in by default but may be useful to some as a plugin. :+1:

ryanlanciaux avatar Feb 19 '16 21:02 ryanlanciaux