How can I use afnFiltering to check if a given row has been filtered out of the list?
How can I use afnFiltering to check if a given row has been filtered out of the list?
I have a custom filter I'm trying to write, where their might be a prior filter associated to the table...
I need to determine if the row that afnFiltering is currently processing has been culled from the table draw from an existing filter.
and if so, send a return false by default.
My current afnFiltering code is as follows: ( I have added a comment on where I expect to enter the code to check if my current row in process has been filtered off the list.
[code]
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
var returnFlg = '';
iLen=myValue.length;
if (iLen == 0)
{
returnFlg = 'Y';
}
else
{
// This is where I need to see if my current column aData[myCol] has been filtered
// Off the list. If it has I will skip the below code to return false by default.
if (isNaN(aData[myCol])==true)
{
var iVersion = aData[myCol];
var myString=iVersion;
for ( i=0 ; i
I need to determine if the row that afnFiltering is currently processing has been culled from the table draw from an existing filter.
and if so, send a return false by default.
My current afnFiltering code is as follows: ( I have added a comment on where I expect to enter the code to check if my current row in process has been filtered off the list.
[code]
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
var returnFlg = '';
iLen=myValue.length;
if (iLen == 0)
{
returnFlg = 'Y';
}
else
{
// This is where I need to see if my current column aData[myCol] has been filtered
// Off the list. If it has I will skip the below code to return false by default.
if (isNaN(aData[myCol])==true)
{
var iVersion = aData[myCol];
var myString=iVersion;
for ( i=0 ; i
This discussion has been closed.
Replies
I came up with a solution that works cleanly! What my main problem is, I needed multiple afnFiltering functions. One for each of my MultiSelect elements. So I incorporated a build of a afnFiltering function on the draw of the MultiSelect element.
[code]
$("thead th.selectBox").each( function ( i ) {
var mySelectHTML = fnCreateSelect( oTable.fnGetColumnData(i), i );
this.innerHTML = mySelectHTML;
if (mySelectHTML != '')
{
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
var multiSelVal = $("#select_"+i).val();
if (multiSelVal == null)
{
return true;
}
else
{
var iLen = multiSelVal.length;
if (isNaN(aData[i])==true)
{
var iVersion = aData[i];
for ( q=0 ; q