-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invert search query #115
Comments
Hi! Good question. Ansible-cmdb uses the jQuery datatables plugin for it's search. There are various ways in which it can be customized. It looks like it supports regex search by setting the second parameter to the search call: https://datatables.net/reference/api/search() I'm not sure if it's possible to change the search parameters after instantiation. Ansible-cmdb doesn't create the search functionality itself. Rather, it is automatically created by the Datatables plugin when calling the constructor. I'll have a look at this when i'm back from vacation next week. I've only got my mobile phone at my disposal right now. Thanks for the feature request! Regards Ferry |
Am I correct in understanding that the instantiation happens at lines 700-722 here? Because it looks like lines 734-741 are just dealing with the permalink. If that's the case, then it seems that there are no parenthesis after the search call, which is confusing me quite a bit (I'm a bash/python guy so this is all foreign to me). It seems like in order to specify search parameters, that I should be able to specify Anyways, I'll keep playing around with it for the time being. Enjoy your holiday! |
Yes the instantiation happens on lines 700-722. The search box is automatically created by DataTables and it looks like it's not possible to easily create our own search() instantiation. I use the fnInitComplete event to automatically perform a search on the table if a search parameter was specified in the URL of the fancy_html page. I do this through fnFilter. It looks someone else tried to do the same thing with a regex: https://datatables.net/forums/discussion/comment/25936/#Comment_25936 Maybe that could be of some help although I haven't tried it yet. :-) |
Moreso, I was just trying to get it to work. It seems like I had to add the fourth argument and set it to false: https://stackoverflow.com/questions/36112455/jquery-datatables-fnfilter-doesnt-work-with-regex And at the moment it works, but only from the URL bar. The dynamic search doesn't respond to regex, but if I change the URL to a regex, it works just fine. I would assume that |
So I guess that the I'm-not-going-to-rewrite-everything-from-scratch answer to this is twofold
There is a distinct possibility of coming up with a button that wraps a search query in Let me know if there would be any interest in seeing if I can implement a button like this, and I'll do my best to get it to the point of issuing a PR. Also, let me know if you'd like me to do the same thing you did with |
Would it be possible to get a way to invert the selection on the search query? I haven't been able to figure out how to do this in
html_fancy.tpl
, and I'm wondering if I don't need to drill down farther in the JS to find it. Anyways, whether it's with an "invert selection" checkbox or just by using regex in the search, I would very much appreciate a way to display an inverse selection of the search results.The text was updated successfully, but these errors were encountered: