Multiple range filters
Multiple range filters
fernandes.glen
Posts: 2Questions: 0Answers: 0
Hi,
how can i have more than on range filter.
currently i have 3 datatables and want to associate a date range filter with each of them.
i tried the example but it filters all the tables wilth the same date.
Thanks in advance
Glen
how can i have more than on range filter.
currently i have 3 datatables and want to associate a date range filter with each of them.
i tried the example but it filters all the tables wilth the same date.
Thanks in advance
Glen
This discussion has been closed.
Replies
Within the afnFiltering function you will need to make use of a reference to the filtering input for that specific table. What I would perhaps suggest is to make use of fnInitComplete and attach the filtering inputs for the table that has been initialised to oSettings (which is unique to each table) - and then use those properties in the filtering function.
Allan
thanks for the reply. can you please give a small code example
Thanks
[code]
$.fn.dataTableExt.afnFiltering.push(
function(oSettings, aData, iDataIndex) {
if (oSettings.sTableId == "TableName1") {
var iMin = document.getElementById('text-min-01').value * 1;
var iMax = document.getElementById('text-max-01').value * 1;
... etc ...
}
if (oSettings.sTableId == "TableName2") {
var iMin = document.getElementById('text-min-02').value * 1;
var iMax = document.getElementById('text-max-02').value * 1;
... etc ...
}
return false;
}
);
[/code]
don't forget event listeners.
It works fine.... ! (my version: 1.7.2)
Regards,