DataTable search
DataTable search
![arnolddd97](https://secure.gravatar.com/avatar/3ded30cd6ca9628f947243f89fece9b6/?default=https%3A%2F%2Fvanillicon.com%2F3ded30cd6ca9628f947243f89fece9b6_200.png&rating=g&size=120)
I just want to search for "0", but but also looking for "10" and "90"
<select id="status-filter"> ' +
'<option value="-1"> Összes</option> ' +
'<option value="0">Beérkezés létrehozva</option> ' +
'<option value="1">Beérkezett</option> ' +
'<option value="2">Vámolás alatt</option> ' +
'<option value="3">Vámolás készen</option> ' +
'<option value="4">Cimke nyomtatva</option> ' +
'<option value="5">Beolvasás alatt</option> ' +
'<option value="10">Áruk beérkeztekt</option> ' +
'<option value="90">Átvételi elismervény nyomtatva</option> ' +
'<option value="999">Szállítási Kivétel</option> ' +
'</select>');
$("body").on("change","#status-filter",function () {
if($(this).val() == "-1"){
table
.column(4)
.search("")
.draw();
}else {
table
.column(4)
.search($(this).val())
.draw();
}
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @arnolddd97 ,
You'll need to use enable regular expressions with
column().search()
, so something likeCheers,
Colin
Unfortunately does not work.
It looks like your code should be working. So I built a simple test case based on your code and it does work:
http://live.datatables.net/remesini/1/edit
In order to help we will need a link to your page or a test case replicating the issue. Maybe you can update my test case to show your issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
i want status = 0 ---> on display all 0 status
Now status is 0 ---> on display all 0 and 10 and 90 status, because like is 0
Thanks for te help.
Hi @arnolddd97 ,
As Kevin said, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin