[
^]
<table ID="tblUploadExcel">
@{int i = 0;}
@foreach (var p in Model)
{
<tr>
<td><label id="WorkItemId_@i">@p.WorkItemId</label></td>
<td>
@Html.TextBox("EstimatedDateTime", null, new { @id = "EstimatedDateTime_" + i })
</td>
<td>@Html.DropDownList("AssignedTo_" + i, (IEnumerable<SelectListItem>)@p.Uinfo, "--Select Name--")</td>
</tr>
i++;
}
</table>
<script>
function Save() {
var rowCount = $('#tblUploadExcel').dataTable().fnGetData().length;
var workList = [];
for (var i = 0; i <= rowCount - 1; i++) {
var WorkItemDetails = {};
WorkItemDetails["WorkItemId"] = $("#WorkItemId_" + i).text();
WorkItemDetails["EstimatedDateTime"] = $("#EstimatedDateTime_" + i).val();
WorkItemDetails["AssignedTo"] = ($("#AssignedTo_" + i).val());
workList.push(WorkItemDetails);
}
var workinfo = JSON.stringify(workList);
var info = { "prodsjson": workinfo };
$.ajax({
type: "POST",
cache: false,
url: '/Admin/WorkDetais',
data: info,
success: function (result) {
},
error: function (xhr) {
console.log(xhr.responseText);
alert("Error has occurred..");
}<
});
}
</script>
I am using "Bootstrap-Table-With-Sorting-Searching-and-Paging" using
<a href="http://www.codeproject.com/Tips/823490/Bootstrap-Table-With-Sorting-Searching-and-Paging">This artical</a>
Issue:- I have 20 recodes in my dataTable and trying to Save.But inputs and labels losing-values-when-paging
Any Idea to make it work
What I have tried:
I was Trying to remove Bootstrap. then its working fine but i need both bootstrap and save all values with single submit