Submit of form containing datatable only includes values for controls if previously changed page row

Submit of form containing datatable only includes values for controls if previously changed page row

ChrisBashawChrisBashaw Posts: 2Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
Note: This is not the issue about data submitted containing only the rows currently being displayed.

Anyone with ideas about this appreciated.

Issue: When I click the submit button of the form containing the data table none of the values (of controls on the table) are being sent to the server. However, if I first change the pagination by changing the select from 10 to 25 and back to 10 again then the data is being posted successfully to the server.

Assumption: The changing pagination length must be looping thru the rows and setting some state flag or similar that somehow triggers the inclusion of the control values during the submit.

Tech:
Data Tables Version 1.9.4, browser:IE10, Code:C#-MVC-Razor-VisualStudio2012-HTMLHelpers, Ajax

DataTable Creation:

$('#UserNoted').dataTable({
"bPaginate": true,
"sPaginationType": "full_numbers",
"bLengthChange": true,
"sDom": '<"H"<"tools">lfr>t<"F"ip>',
bAutoWidth": false,
"bSort": true,
"bJQueryUI": true,
"aoColumns": [
{ "sSortDataType": "dom-checkbox" },
{ "sClass":"myhidedpass", "sSortDataType": "dom-hidden", "bSearchable": false },
null,
null,
null,
]});
$("div.tools").html('

Replies

  • webiiwebii Posts: 1Questions: 0Answers: 0
    edited May 2013
    I was facing the same problem and solve it by this way.May be it will help you.
    I just apped all remaing recods in my form on form submit event. So in that way all the fields are being posted.
    Here is my code.
    [code] var table = $('#paging_container').dataTable( {
    "sPaginationType": "full_numbers",
    "bStateSave": true,
    "bPaginate": true,
    "bLengthChange": true,
    "bFilter": true,
    "bSort": false,
    "bInfo": true,
    "bAutoWidth": false
    } );
    $("#formID").submit(function () {
    var hiddenArea = $("
  • ChrisBashawChrisBashaw Posts: 2Questions: 0Answers: 0
    Thanks for this. I gave it a try. Doesn't solve my problem though. My problem is that none of the data in the table on the form is being posted back to Controller. I think this suggested solution is to get the data in the hidden rows to be included in post. My problem is a little different.

    Can anyone think of a reason that changing the length drop combo (number of rows to display) to anything else not only changes the number of rows displayed but also somehow must be setting a flag or some other state variable for all the controls in the data table and clicking on my save (post) button does include the data for the controls in the data table. Thanx!
This discussion has been closed.