Searchpanes filters are not taking into consideration when using Datatables search input

Searchpanes filters are not taking into consideration when using Datatables search input

razorxxxrazorxxx Posts: 4Questions: 1Answers: 0

In the example at this website you can reproduce the problem:
https://datatables.net/extensions/searchpanes/examples/initialisation/cascadePanes.html

When cascadePanes = true, after selecting some filter at SearchPanes, if you do a search using the DataTables search input, it is not searching on the dataset of filters applied, instead it is searching on the whole dataset. In the example, if you choose 'Accountant' in the first pane and then type 'London' at the table search input, it searchs this word on the whole data and SearchPanes are recalculated in order the new criteria.

On the other hand, if cascadePanes = false then it searchs taking into consideration SearchPanes filters applied and SearchPanes are not recalculated.

Is there any possibility of change this behavior?

Thanks in advance.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Yes, that looks like an error in SearchPanes, basically doing a reset when the global search is applied. Unfortunately I don't have an immediate fix for that, I'll need to look into it when I next can.

    Allan

  • razorxxxrazorxxx Posts: 4Questions: 1Answers: 0

    Thanks for your answer.

    No problem, take your time and I will visit this post periodically in order you had got a workaround.

    You might consider convert it in a new property (we can call it 'keepFilters'):
    false = continue using the current behavior (search in the whole dataset and recalculate searchpanes)
    true = search only in the data already filtered with SearchPanes.

    This property should be independent of cascadePanes value.

    Regards.

Sign In or Register to comment.