How to set a default selected value in SearchList on table initialization?

How to set a default selected value in SearchList on table initialization?

Just1nJust1n Posts: 1Questions: 1Answers: 0

Hi,

I’m using DataTables 2 with the new columnControl + searchList features.
Everything is working, but I would like to pre-select a value in the SearchList when the table loads, while still allowing users to change the selection afterwards.

Here is a simplified version of my current configuration: https://live.datatables.net/jivapopa/1/edit

The table is filtered correctly on load, but the SearchList itself does not show “London” as selected.
I would like the SearchList UI to reflect the default filter selection.
And if I try to change the SearchList selection after the default filter is applied, it shows no results.

Any help or guidance would be appreciated — thanks!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 65,360Questions: 1Answers: 10,844 Site admin
    Answer ✓

    Hi,

    I'm afraid there isn't an option to programmatically set the search terms for the ColumnControl feature at the moment. That is something that I can look into adding in future.

    Regards,
    Allan

Sign In or Register to comment.