Multifilter with OR operator

Multifilter with OR operator

martoofmartoof Posts: 32Questions: 0Answers: 0
edited June 2011 in General
Hello !
The syntax 'option1|option2|...|optionN ' does not work...
[code]
$('#example').dataTable().fnFilterAll( 'option1|option2|...|optionN ',columnNo,true,false);
[/code]
can you correct my code ?
and by the way, can you tell me in simple words what is 'true' and 'false' ?
I read this : http://datatables.net/plug-ins/api#fnFilterAll , but it's really complicated to a french as me !

Thanks

Replies

  • martoofmartoof Posts: 32Questions: 0Answers: 0
    edited June 2011
    Allan ?!
    Can you help me ?
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    I think the fnFilterAll method is slightly out of date there (i.e. from v1.6) and doesn't align with http://datatables.net/api#fnFilter . I've just updated the fnFilterAll plug-in for 1.7+ and I thin basically you want to pass:

    Parameter 3 as true (meaning it is regex)
    Parameter 4 as false (meaning don't use smart filtering)

    Allan
  • martoofmartoof Posts: 32Questions: 0Answers: 0
    thank you for your answer allan !
    I updated datatable.

    How do I filter all my tables with OR conditions?
    You had previously advised to use fnFilterAll ... I am a bit lost and I despair!
    Here is my code :
    [code]
    $(".table_a_filtrer").dataTable().fnFilterAll('option1'||'option2',4,false);
    [/code]
    This does not work, even with a "fnFilter"

    If I do not understand what you said, I'm sorry, I'm french and google translation helps a lot!

    Thank you for your interest in my topic !
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    You need the new http://datatables.net/plug-ins/api#fnFilterAll - update the function first. Then:

    [code]
    $(".table_a_filtrer").dataTable().fnFilterAll('option1|option2', 4, true, false);
    [/code]
    should work.

    Allan
  • martoofmartoof Posts: 32Questions: 0Answers: 0
    Perfect!
    Thank you very much Alan, you are my savior :)
This discussion has been closed.