Detect if searchpanes is enabled

Detect if searchpanes is enabled

mattleesmattlees Posts: 16Questions: 8Answers: 0

Hi,

How can I detect if searchpanes has been enabled?

Issue is in some javascript i'm calling: dt.searchPanes.clearSelections();

This is in a class I've written, and if searchpanes isn't enabled it is failing and halting the script at: Uncaught TypeError: Cannot read property 'clearSelections' of undefined.

Was hoping to have an if statement, if (searchpanes enabled) { clearselections }

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    edited July 2020 Answer ✓

    There isn't an API call to tell if it's enabled, but you could check for the SearchPanes container - something like:

    if ($('.dtsp-panesContainer').length) { console.log('enabled') }
    

    Colin

  • mattleesmattlees Posts: 16Questions: 8Answers: 0

    Thanks, works perfectly

This discussion has been closed.