manual setting of total number of records/records number at datatable num
manual setting of total number of records/records number at datatable num
Hello.
I'm trying to dinamic create my datatable (dt) header from server side.
what happens is that after the initial post where i get both data and column header info i had a 2nd post to the server (which is irrelevante because i already had my data).
So i disable it but then my dt is not properly initialized - i lost "navigation buttons and paging info displays for example 1 of -1 of -1 total records.
is there any way of preventing the 2nd postback but having a "proper" dt initialization?
this is my code:
this.initialize = function () {
internalHtmlID = getHtmlIdentifier(id);
$.ajax({
method: "GET",
url: url
})
.done(function (data) {
internalHtmlID = getHtmlIdentifier(id);
var oTable = $('' + internalHtmlID + '').dataTable({
"aaSorting": [[0, "desc"]],
"bServerSide": true,
"processing" : true,
"deferLoading": -1,
"aaData": data.aaData,
//"aaData": null,
"aoColumns": data.aoColumns,
"ajax": {
"url": url,
"dataType": "json"
}
});
oTable.fnDraw(false);
})
.fail(function (msg) {
});
};