DataTablesSrc
DataTablesSrc copied to clipboard
Filtering performed both in search and draw
Hi!
I've being profiling search functionality and it came in view that when doing dt.column(0).search(...).draw()
DT runs filtering twice. First time when search
is called, then second time with draw
. That looks a bit weird. I might not understand if there is any underlying reasons that covers, but it looks like a bug. From my understanding, search
to be actually output to UI need to be finished with draw
call, thus I have question is there a need to perform actual search twice? In case I chain up multiple search
calls and finish that with draw
call, then I'll get multiple passes. Searches are not identical, however. The difference is in 3rd parameter (iForce
) passed into _fnFilterComplete
.
Is this real issue? Am I missing something?
I haven't had a chance to look into it yet - but it sounds like it might be a bug. Only on draw should it do the filter. I'll look into it and reply back when I can.
Its 4 years and counting and no reply. Has this issue been resolved?
Its not no - its slipped by me as I've been working on other things. Its still here though, and anyone is welcome to pick it up if they like. It is something I will look into when I can - things are just busy :-).
Can you refer me to the section of code.
I can't be sure where the problem actually is, but there is where I would start: https://github.com/DataTables/DataTablesSrc/blob/941a2f037381bcd19e64f08c1bb766fc20497373/js/core/core.draw.js#L461 .