SearchPane - Pre-populate with options

SearchPane - Pre-populate with options

mattleesmattlees Posts: 16Questions: 8Answers: 0

Hi,

Is it possible to pre-populate with options even though there is no valid data yet?

An example would be: https://datatables.net/extensions/searchpanes/examples/initialisation/simple.html

Inserting an 'Office' for Paris even though there is no corresponding row with that data.

Reason... Using this for a daily log, wanting it so departments can open at the start of the day and select their department even though no data exists yet. The page auto refreshes from the ajax feed and the logs appear for their department.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 57,703Questions: 1Answers: 9,195 Site admin
    Answer ✓

    Sort of! You can define custom options using columns.searchPanes.options (example here) which would allow what you are looking for. But it needs a matching function to be specified as well - that would perhaps be as simple as a direct comparison in this case.

    I'll look at how we could make the function optional, so you'd just need an array of labels.

    Allan

  • mattleesmattlees Posts: 16Questions: 8Answers: 0

    Gotcha! I use that elsewhere, didn't think of it for this case. That'll work perfectly.

    Thanks!

Sign In or Register to comment.