Generate datatable from HTML form

Generate datatable from HTML form

WoPrWoPr Posts: 7Questions: 0Answers: 0
edited April 2013 in General
I am creating a search engine for an intranet. There are lots of entries to display, so I decided to use Jquery Datatables to show the data with a server side script. The problem I found is that I dont know how to send the input fields of the HTML form to the server and get the response. I think that I have to use fnServerData and fnDraw funtions, because I need to regenerate the data with each different search, but I don't know how to apply this functions...

How can I perform this?

Replies

  • essexstephessexsteph Posts: 57Questions: 0Answers: 0
    To get any meaningful help, we need to know a bit more, like what your server side script will be written in, how many entries you need to display etc. All the information you need to know about DataTables is on this site in the examples and parsing a form is a standard task in any server side scripting language.

    I would suggest you start off getting your form working and being submitted to the server and then get the server generating the JSON you need for DataTables to display it.
  • WoPrWoPr Posts: 7Questions: 0Answers: 0
    edited May 2013
    This is whatI was looking for:

    [code]
    "fnServerData": function ( sSource, aoData, fnCallback ) {
    $.getJSON( sSource, aoData.concat($("#buscador-form").serializeArray()), function (json) {
    fnCallback(json)
    } );
    }
    [/code]
This discussion has been closed.