table Rows not added on ajax call
table Rows not added on ajax call
KarthikTv
Posts: 2Questions: 1Answers: 1
HTML Code:
<table id="table" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>ModemName</th>
<th>AssignedTo</th>
<th>AssignDate</th>
<th>ReturnedDate</th>
<th>CreatedName</th>
</tr>
</thead>
</table>
JS Code:
$(document).ready( function () {
var oTable = $('#gvAssgin').dataTable
({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "AssignHistory.aspx/getAllModemAssign",
"fnServerData": function(sSource, aoData, fnCallback) {
$.ajax({
type: "POST",
url: "AssignHistory.aspx/getAllModemAssign",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{}",
success: function (json) {
},
error: function (xhr, textStatus, errorThrown) {
alert(xhr.responseText);
}
});
},
"columns": [
{ "data": "ModemName" },
{ "data": "AssignedTo" },
{ "data": "AssignDate" },
{ "data": "ReturnedDate" },
{ "data": "CreatedName" }
]
});
} );
In result i can see the values in browser debugging but, values are not adding to the table
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Got what i need from the below link, I sure this might help someone else like me
https://cmatskas.com/server-side-jquery-datatables-with-asp-net/