Generate datatable from HTML form
Generate datatable from HTML form
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?
How can I perform this?
This discussion has been closed.
Replies
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.
[code]
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.getJSON( sSource, aoData.concat($("#buscador-form").serializeArray()), function (json) {
fnCallback(json)
} );
}
[/code]