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('<label id="SelectAllNone";"><input id="SelectAllNoneC" type="checkbox" style="width: 1em;"/>Select All/None</label>');
HTML Table Creation:
table border="0" class="display" id="UserNoted">
<thead>
<tr>
<th>Select</th>
<th>HiddenSelectVal</th>
<th>Name</th>
<th>Email</th>
<th>Role(s)</th>
</tr>
</thead>
<tbody>
@for (Int32 i = 0; i < Model.NoteUsersList.Count; i = i + 1)
{
<tr>
<td>
@Html.CheckBoxFor(x => x.NoteUsersList[i].Checked)
</td>
<td>
@Html.HiddenFor(x => x.NoteUsersList[i].userrole)
@Html.HiddenFor(x => x.NoteUsersList[i].displayname)
@Html.HiddenFor(x => x.NoteUsersList[i].email)
@Html.HiddenFor(x => x.NoteUsersList[i].usersid)
</td>
<td>@Model.NoteUsersList[i].displayname</td>
<td>@Model.NoteUsersList[i].email</td>
<td>@Model.NoteUsersList[i].userrole</td>
</tr>
}
</tbody>
</table>
HTML Form Creation:
@using (Ajax.BeginForm("EditUserPrefs",new { id = Model.editee_userid },new AjaxOptions() { HttpMethod = "POST",UpdateTargetId = "ui-tabs-4",InsertionMode = InsertionMode.Replace }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true,null,new { @class = "ValErrorMsg" })
<Table is here>
<input type="submit" class="button blue" value="Save" />
} @* end of @using *@
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('<label id="SelectAllNone";"><input id="SelectAllNoneC" type="checkbox" style="width: 1em;"/>Select All/None</label>');
HTML Table Creation:
table border="0" class="display" id="UserNoted">
<thead>
<tr>
<th>Select</th>
<th>HiddenSelectVal</th>
<th>Name</th>
<th>Email</th>
<th>Role(s)</th>
</tr>
</thead>
<tbody>
@for (Int32 i = 0; i < Model.NoteUsersList.Count; i = i + 1)
{
<tr>
<td>
@Html.CheckBoxFor(x => x.NoteUsersList[i].Checked)
</td>
<td>
@Html.HiddenFor(x => x.NoteUsersList[i].userrole)
@Html.HiddenFor(x => x.NoteUsersList[i].displayname)
@Html.HiddenFor(x => x.NoteUsersList[i].email)
@Html.HiddenFor(x => x.NoteUsersList[i].usersid)
</td>
<td>@Model.NoteUsersList[i].displayname</td>
<td>@Model.NoteUsersList[i].email</td>
<td>@Model.NoteUsersList[i].userrole</td>
</tr>
}
</tbody>
</table>
HTML Form Creation:
@using (Ajax.BeginForm("EditUserPrefs",new { id = Model.editee_userid },new AjaxOptions() { HttpMethod = "POST",UpdateTargetId = "ui-tabs-4",InsertionMode = InsertionMode.Replace }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true,null,new { @class = "ValErrorMsg" })
<Table is here>
<input type="submit" class="button blue" value="Save" />
} @* end of @using *@