How do you globally turn regex search on and off?
How do you globally turn regex search on and off?
joeborg
Posts: 1Questions: 1Answers: 0
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
This discussion has been closed.
Answers
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 )
(wheretoggle
istrue
orfalse
) which would basically have the same effect since the previous setting is used for the regex setting for the next search.Allan