my custom search filter array affect on dataTable upon sorting!

my custom search filter array affect on dataTable upon sorting!

RahilNITRahilNIT Posts: 1Questions: 1Answers: 0
edited February 2017 in Free community support

when i attempt to sort a column in my dataTable, the table should draw again .. and my search filter arrays affect on the redraw process, but in the search arrays what returns, is False. it means I dont have any case to be filtered . but my data cut down and from 541 row showing just 29 row after sorting!
my search filter is :

$.fn.dataTable.ext.search.push(function (settings, data, dataIndex) {
var minVal = $('#txtmin_' + criteriaCode).val().replace(/,/g, '');
var maxVal = $('#txtmax_' + criteriaCode).val().replace(/,/g, '');
var columnData;
switch (settings.sTableId) {
case 'xStockDataTable':
columnData = parseFloat(data[index + 4]);
break;
case 'xSectorDataTable':
columnData = parseFloat(data[index + 2]);
break;
case 'xIndexDataTable':
columnData = parseFloat(data[index + 2]);
break;
}
if (minVal <= columnData && columnData <= maxVal) return true;
console.log('false') // when attempt sorting widouth any change on min and max it returns false
return false;
});

it seams all right and it should not affect of my sorting button.But the point is when i comment this function my sorting works right!

This discussion has been closed.