Filter/Exclude the word "Never" from Table
Filter/Exclude the word "Never" from Table
I can do the following and it filters out everything except for rows containing "Never"...
oTable.columns(6).search('Never').draw();
As amazing as DataTables is, why can't it be as simple as doing:
.search(!'Never')
Basically, I have a table that is displaying from an Admin panel, a list of users and their last logins to the site. I want to filter on the word "Never" so it only shows users that have an actual login date. The Last Logon column is column 6.
Checking with Google, it brought me to one example using a regEx which I don't see why I would need that to exclude a word from the search, then again, maybe I'm misunderstanding regular expressions. If someone could provide me an example, I would greatly appreciate it.
Thanks,
muttBunch
This question has accepted answers - jump to:
Answers
Forgot to mention that I have this tied to a checkbox
When you say 'exclude' rows that have 'Never', do you mean remove those rows entirely from the table. If so, this example from this thread should help - it's talking about removing duplicate rows but the same principles would apply,
Colin
Use a regex expression and enable regex and disable smart search for the
column().search()
call. See thesearch()
docs and this example for more info.Kevin
Thank you, will give both suggestions a try and mark answers. Thanks again
I was able to do it with the following regex, thanks again for your help