Data table select input filter
Data table select input filter
I seek for a fast solution, and i don't found it, i made a personalized filter. It is in the right way or not. I post my solution.
$.fn.dataTable.ext.search.push(function( settings, data, dataIndex ) {
var show=true;
var i=0;
$("#"+settings.sTableId).find('thead input').map(function(){
value=$(this).val();
if($.trim(value)!=''){
if($(settings.aoData[dataIndex].anCells[i]).find('select').length)
data[i]=$(settings.aoData[dataIndex].anCells[i]).find(':selected').val();
else
if($(settings.aoData[dataIndex].anCells[i]).find('input').length)
data[i]=$(settings.aoData[dataIndex].anCells[i]).find('input').val();
show=show&&((' '+data[i]).indexOf(value));
if(!show) return show;
}
i++;
});
return show;
});
Replies
So fast , no time to explain... http://yadcf-showcase.appspot.com/
:)