Ignoring HTML when filtering not working

Ignoring HTML when filtering not working

sviviansvivian Posts: 13Questions: 0Answers: 0
edited November 2012 in General
I have a table that I want to filter. One column has some HTML, this is specified in the aoColumns parameter with sType: 'html', but it's still using the HTML when filtering.

Here is the example page: http://pokemondb.net/item/all
If you type "sprite" in the box, nothing get filtered because the images all have a class of "sprite". Other phrases filter properly. Here is the JS code for the table:

[code]
// this is set in the included file
var dtParams={aoColumns:[],bPaginate:!1,bAutoWidth:!1,bInfo:!1,bProcessing:!0,asStripClasses:[],sDom:"rt"};

// from line 4051
$(window).load( function() {
dtParams.aoColumns = [
{ sType: 'html' }, // name
null, // cat
{ bSortable: false }, // effect
];
oTable = $('.data').dataTable( dtParams );
oHeader = new FixedHeader( oTable );

var $fltName = $('#itfilter_name');
$fltName.keyup( function() {
oTable.fnFilter( this.value );
} );
if ( $fltName.val() != '' )
oTable.fnFilter( $fltName.val() );
} );
[/code]

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Unfortunately a commit for 1.9.4 broke that feature. The commit that fixes it is here: https://github.com/DataTables/DataTables/commit/065c2cc . That's in the 1.10 development version at the moment, but the patch there should apply to 1.9.4 if you need.

    Allan
This discussion has been closed.