Data table select input filter

Data table select input filter

duranguenzeduranguenze Posts: 1Questions: 0Answers: 0
edited December 2014 in Free community support

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

This discussion has been closed.