Filtering and table displays with no records
Filtering and table displays with no records
I have the following code that is running to filter my records. I start with 20 records and based on what's filtered, this should filter it down to 2. When I step through, I do see that true is returned for 2 records, but the table now displays empty instead of displaying the 2 records that I would expect.
Code:
$.fn.dataTableExt.ofnSearch['guestType'] = function (sData) {
var guestFilter = $("#hdnGuestTypeFilter").val();
if (guestFilter == '') //if no filter, return all records
return true;
else { //if the filter has a value, get the value from the current record and look at data
var rowGuestTypesIndex = sData.indexOf('guestTypes=') + 12;
var rowGuestTypes = sData.substring(rowGuestTypesIndex, sData.length - 4);
return (rowGuestTypes.indexOf(guestFilter) > -1);
}
I thought that maybe I'm missing a call to draw or redraw, but that doesn't seem to be it. Any suggestions?
Code:
$.fn.dataTableExt.ofnSearch['guestType'] = function (sData) {
var guestFilter = $("#hdnGuestTypeFilter").val();
if (guestFilter == '') //if no filter, return all records
return true;
else { //if the filter has a value, get the value from the current record and look at data
var rowGuestTypesIndex = sData.indexOf('guestTypes=') + 12;
var rowGuestTypes = sData.substring(rowGuestTypesIndex, sData.length - 4);
return (rowGuestTypes.indexOf(guestFilter) > -1);
}
I thought that maybe I'm missing a call to draw or redraw, but that doesn't seem to be it. Any suggestions?
This discussion has been closed.