4 ms·
I think the issue is that, if you are doing something like sorting, you actually are going to have to redraw the entire table. Also, for things like plain-text
by JangoSteve 13y ago
I think the issue is that, if you are doing something like sorting, you actually are going to have to redraw the entire table.
Also, for things like plain-text searching, it's faster to do it on a collection of objects detached from the DOM in JavaScript than to scan the DOM, and especially if you're doing non-text comparisons (like comparing a number with the parseFloat representation of the values in one of the table columns for all rows).
And finally, if you are going to read and then redraw in the DOM, it's best to do it as grouped atomic operations due to the inefficiency making the browser reflow (https://developers.google.com/speed/articles/reflow https://developers.google.com/speed/articles/reflow).
For what it's worth, this is how Dynatable works internally, though I haven't had any issues with it being slow, though it's possible I just haven't used it with large enough data sets yet (I've only used it on tables of probably 1000 rows or less so far).