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?

binro01binro01 Posts: 6Questions: 0Answers: 0
edited August 2012 in General
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

Replies

  • binro01binro01 Posts: 6Questions: 0Answers: 0
    Any help on how I can figure out if an existing node is currently not filtered out for display would be much appreciated. I been banging my head for a good 24 hours on this now. I need some sleep!! LOL
  • binro01binro01 Posts: 6Questions: 0Answers: 0
    And this is why I love DataTables! Its so flexible!

    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
This discussion has been closed.