I want to send Data tables data to the Controller method in Java.

I want to send Data tables data to the Controller method in Java.

Arun KArun K Posts: 2Questions: 1Answers: 0

I followed what was given in http://www.cscc.edu/_resources/app-data/datatables/examples/api/form.html. But the alert is not showing up any data for me.

var sTable = $('#managerDetailsTbl').DataTable();
var data = sTable.$('input').serialize();
alert(data); /* This alert give me empty data*/

Datatable:
$('#managerDetailsTbl').dataTable({
"columnDefs": [
{ "orderable": false, "targets": 0 },
{ "bSearchable": false, "targets": [ 0 ] }
],
"order": [[ 4, 'desc' ]],
dom: '<"opertoolbar1">rtip',
});

Please help me with this.

Answers

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    Your link throws a 404. Do you mean this example?
    https://datatables.net/examples/api/form.html
    If so, check the differences between what you have and what the example has.
    Do you have the correct HTML? You clearly don't have the correct Javascript.

  • Arun KArun K Posts: 2Questions: 1Answers: 0

    whats wrong in my Java script??

    <input type="button" value="Submit" onClick="submitUpdatedManagerRecords()"/>

    function submitUpdatedManagerRecords(){

    var sTable = $('#managerDetailsTbl').DataTable();
    var data = sTable.$('input').serialize();
    alert(data);
    }

This discussion has been closed.