How to get an initial search using server-side processing?

How to get an initial search using server-side processing?

gallengallen Posts: 2Questions: 1Answers: 0

I am trying to get an initial search to happen using server-side processing when my table is first loaded. I have set up the search option with my initial term, and it appears in the search box when the page is loaded.

However, the call to my server-side ajax routine does not include the search term.

How can I make that happen?

Here's my initialization code:

    $('##recipients').DataTable({
        processing: true,
        responsive: true,
        scrollX: true,
        serverSide: true,
        ajax: { url : /ajax/info.cfm",
                type : "POST"},
        },
        search: {
              "search": "Fred"
        }
    });

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 4,693Questions: 0Answers: 823
    Answer ✓

    Hi @gallen ,

    That's working for me - see here.

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • gallengallen Posts: 2Questions: 1Answers: 0

    Thanks, @colin . I was afraid I was missing an option somewhere to pass the option to the server. Seeing your example made me take a closer look, and it is being passed and there was a problem with my ajax routine.

    Sorry for the noise.

Sign In or Register to comment.