jquery datatables select search
jquery datatables select search
slayerking
Posts: 4Questions: 0Answers: 0
I am using jquery datatables in my application but the search ignores the html select tag value.I am able to search using the value of input tag though.
How can i extend the datatables to also search for the select tag ?
Here is a jsfiddle http://jsfiddle.net/hBa3a/ when I search for gecko It doesn't filter the value
How can i extend the datatables to also search for the select tag ?
Here is a jsfiddle http://jsfiddle.net/hBa3a/ when I search for gecko It doesn't filter the value
This discussion has been closed.
Replies
Currently, there isn't a built in way to search on live DOM data such as getting the value from a select list I'm sorry to say. The live DOM sorting sort of does it ( http://datatables.net/release-datatables/examples/plug-ins/dom_sort.html ), but I think I'd need to spend some time developing an identical solution for filtering. Its on my to-do list, but a little way off.
Allan
Thanks for your reply..
Tangerine I just made it for demo.. Sorry It's not the full code right there..
I am using the fields right there to make the row editable and there's a additional column with a save button. So, that way i don't need a separate edit page.. That's the whole idea :)
And Allan ,
It does support filtering from [code] [/code] right ?
Like in my fiddle when I search for [quote]Win 98[/quote] It does filter the correct record
Is there something like
[code]
$('#example').dataTable({
"sPaginationType": "full_numbers",
beforeSearch: function (keyword, cell_value) {
return $(cell_value).val() == keyword
}
});
[/code]
So no, it doesn't work as you want it to.
Allan