How do I limit search paramter only to one column in datatables only when using URL paramter
How do I limit search paramter only to one column in datatables only when using URL paramter
Noodles12
Posts: 113Questions: 41Answers: 2
I am working on a datatable where I need to limit the search to one column only when using paramater.
example:abc.com?search=test. But, if not passing parameter, it should search all columns. How do I achieve this?
Here is the code I have. Here is the fiddle: http://live.datatables.net/piquxewa/1/edit
Replies
I'm not clear what you would be searching on if there's a parameter - does the search string get passed in a different way?
That said, if you move the logic into
initCompete
, you can search however you like - something like this:See example here,
Colin
Thankyou. This is very helpful. I need this as I want the datatable to search the entire table when user is on that specific page. However, when the user comes from a different page (link with paramter), he should be able to get the results prefiltered for the text entered only for the specific column. Hope it makes sense.