Pass Search as parameter to the server processing

Pass Search as parameter to the server processing

kyennetikyenneti Posts: 8Questions: 0Answers: 0
edited June 2009 in General
Allan,
Is it possible to pass a search string while using the Server side processing. Instead of coming from the user entered data in search box, I would like to pass something like $sSearch = 'Searchthis' .

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi kyenneti,

    You certainly can do this. If you have a look at this example for adding another variable to send to the server ( http://datatables.net/1.5-beta/examples/server_side/custom_vars.html ) you'll be able to see how you can write a function which DataTables will use to retrieve data form the server. Here you can either intercept the search string (sSearch) or just define a new variable and use the logic on the server-side to deal with it.

    Regards,
    Allan
  • kyennetikyenneti Posts: 8Questions: 0Answers: 0
    Great.. that worked like a charm.
    thank you.
    Kalyan
  • spitfire45spitfire45 Posts: 18Questions: 0Answers: 0
    Hi Allan,

    This questions seems to answer what I was looking for, but the page with the example is unfortunately no longer available.

    I was looking to introduce a value e.g 100033 as in productId = 100033 to use in the MYSQL query for server side processing.
  • UPEngineerUPEngineer Posts: 93Questions: 0Answers: 1
    spitfire45,

    Try this link. I think it is what you are looking for.

    http://datatables.net/examples/server_side/custom_vars.html
This discussion has been closed.