ajax data filter

ajax data filter

MeowMeowMeowMeow Posts: 4Questions: 1Answers: 0

hello.

example1 Table, I want data.office to print only 'London' data.
Also example2 Table, data.office is 'San Francisco'.

my jsfiddle.
https://jsfiddle.net/xt9hjar2/3/

Is it possible? Please let me know how.

thanks

This question has an accepted answers - jump to answer

Answers

  • rf1234rf1234 Posts: 2,946Questions: 87Answers: 416
    edited March 2020 Answer ✓

    https://jsfiddle.net/4jtncdqh/

    You can also use this initialization option instead of the "init" event:
    https://datatables.net/reference/option/initComplete

  • MeowMeowMeowMeow Posts: 4Questions: 1Answers: 0
    edited March 2020

    I solved this problem. thanks your reply! ^---^

  • MeowMeowMeowMeow Posts: 4Questions: 1Answers: 0
    edited March 2020

    Please tell us if data.office is London or New York.

    How do you do it?

  • rf1234rf1234 Posts: 2,946Questions: 87Answers: 416

    it's in the fiddle I posted:

    example1.on('init', function() {
        example1.column(2).search(office).draw();
    })
    

    same for the second example

  • MeowMeowMeowMeow Posts: 4Questions: 1Answers: 0

    i find that, two value search
    example1.column(2).search('London|New York' , true, false).draw();

    is right? thanks :)

  • rf1234rf1234 Posts: 2,946Questions: 87Answers: 416

    Glad you got it working. Didn't know that you meant to see both, London and New York. Cheers

This discussion has been closed.