How to do a custom filter on multiple columns on the table

How to do a custom filter on multiple columns on the table

sagiveghsagivegh Posts: 2Questions: 0Answers: 0
edited December 2009 in Plug-ins
Hi,

We have a problem, that we want to create a new filter, that know to filter a few words, with separation like ';'
and show only the rows that this words are appear on it,
like if the string will be "sagi;vlada;google"
so, just the rows with sagi, vlada and google, will show in the table,
is it possible to implement from the current filter, or we need to do a new one?

Thanks,
Sagi

Replies

  • allanallan Posts: 61,663Questions: 1Answers: 10,095 Site admin
    Hi Sagi,

    Yes, this will work with DataTables as it stands - all you need to do is call fnFilter with the filter string "sagi vlada google". For example:

    [code]
    oTable.fnFilter( "sagi vlada google" );
    [/code]
    This works because DataTables basically does an 'AND' with space separated words on the global filter.

    Regards,
    Allan
This discussion has been closed.