search on special characters
search on special characters
rohit99
Posts: 22Questions: 9Answers: 0
we need to search on special characters with rang filter.
like: salary type columns "$ 150,000"
This discussion has been closed.
Answers
If you want to use a range filter, you need to implement a custom search plug-in. If you do that, you could just strip out non-numeric characters.
Allan
Thanks for help.
But we have some trouble in
$.fn.dataTable.ext.search.push
If we use multiple table on one page. This method performed on both tables, but we need only one table.
We use this, but not working
$.fn.dataTable.ext.search.push(
function (settings, data, dataIndex) {
if (settings.nTable == document.getElementById('tblFlowdown')) {
That should be how to do it. If it isn't working for you, please link to a test case showing the issue.
Allan
This is worked, if we use multiple table on one page.
This method performed on both tables, but we need only one table.
We can change $.fn.dataTable.ext.search.push to any other method ?
$.fn.dataTable.ext.search.push(
function (settings, data, dataIndex) {
if (settings.nTable == document.getElementById('tblFlowdown')) {
var _salary = data[8];
We can change $.fn.dataTable.ext.search.push to any other method. Just like ('#tblFlowdown').DataTable().column(col).
No not yet. That is something that will be added in a future version of DataTables.
At the moment you need to do an id check inside your custom filtering function, just like you have done.
Allan