How do you globally turn regex search on and off?

How do you globally turn regex search on and off?

joeborgjoeborg Posts: 1Questions: 1Answers: 0
edited July 2016 in Free community support

I have added a button to a datatable using the 'buttons' setting. I want this to be a toggle that turns regex search on and off i.e. changes the value of 'search[regex]' in the GET request. I can see how to do this if I make the search programatically, but I want to switch the initial setting of dataTable({search: {regex: false}}) rather than intercepting each search and inject the setting.

Thanks

Answers

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin

    There currently isn't really an option to toggle the state of the global regex after initialisation, other than via the search() method I'm afraid.

    On the plus side, you should be able to do: table.search( table.search(), toggle ) (where toggle is true or false) which would basically have the same effect since the previous setting is used for the regex setting for the next search.

    Allan

This discussion has been closed.