Datatable search multiple columns and multiple values

Datatable search multiple columns and multiple values

davdavcocodavdavcoco Posts: 5Questions: 2Answers: 0
edited May 2019 in Free community support

Im trying to search about multiple columns with different values each columns.
Col A parameter : John
Col B parameter : U.S.A

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    Hi @davdavcoco ,

    Use column().search(),

    Cheers,

    Colin

  • davdavcocodavdavcoco Posts: 5Questions: 2Answers: 0

    Hey thanks for fast answering @colin
    do i just need to use that and search multiple times, like
    dTable.column(0).search(parameter1).draw()
    dTable.column(1).search(parameter2).draw() ?

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    Yep, or you can chain it together so it only needs the one draw - see here.

    C

  • davdavcocodavdavcoco Posts: 5Questions: 2Answers: 0

    @colin
    sry before... i can't open the link u provide.. it is only show like javascript and animation..

  • colincolin Posts: 15,144Questions: 1Answers: 2,586
    Answer ✓

    Yep, if you run it, it'll show you how to do the search.

    It's only doing this:

      table.column(1).search('director').column(2).search('london').draw();
    

    so you won't miss much if it doesn't work for you...

  • davdavcocodavdavcoco Posts: 5Questions: 2Answers: 0

    thanks @colin
    works well :)

This discussion has been closed.