passing input text to dateable column search
passing input text to dateable column search
Hello, I am trying to send an HTML input as text to:
table.column(1).search(searchQuery).draw();
however it seems to not like all type of text. So if my input is 1 it works fine. however if my input is a conditional statement
then it fails. for instance if my input is:
(d) => d > 1 && (d) < 3
it fails.
but if I do the following it works:
table.column(1).search((d) => d > 1 && (d) < 3).draw();
so I am assuming it doesn't handle text as I thought it did? or is there another trick to achieve this?
Thank you.
Answers
I haven't tried anything like this with
column().search()
but it seems it might return a boolean value. What are you expecting it to return? The(d) => d > 1 && (d) < 3
being passed intocolumn().search()
is a function. However when getting the value of an HTML input it will be a string. The string will need to be parsed into something you can use withcolumn().search()
.Possibly I'm misunderstanding something. Please build a simple test case with an example fo your column 1 data and describe how you want to use the HTML input to search.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin