DataTablesSrc icon indicating copy to clipboard operation
DataTablesSrc copied to clipboard

Filtering performed both in search and draw

Open kkopachev opened this issue 8 years ago • 5 comments

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?

kkopachev avatar Oct 03 '16 18:10 kkopachev

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.

DataTables avatar Oct 03 '16 21:10 DataTables

Its 4 years and counting and no reply. Has this issue been resolved?

josiahking avatar Feb 20 '20 09:02 josiahking

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 :-).

DataTables avatar Feb 20 '20 09:02 DataTables

Can you refer me to the section of code.

josiahking avatar Feb 20 '20 09:02 josiahking

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 .

DataTables avatar Feb 20 '20 09:02 DataTables