Datatable loading too slowly

Datatable loading too slowly

harikrishnanharikrishnan Posts: 10Questions: 0Answers: 0
edited April 2012 in DataTables 1.9
Hi
Style is rendering very slowly.It takes more than 6 seconds to load.Am using ColVis,sorting option together.My code is her.Am using thia as partial view in mvc architecture


var asInitVals = new Array();
$(document).ready(function () {
var oTable = $('#tblwrapper ').dataTable({
"bDeferRender": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": { "sSearch": "Search all columns:" },
"sDom": 'RT<"clear"><"H"lfr>t<"F"ip>C',
"sScrollY": "200px",
"bScrollCollapse": true,
"bScrollAutoCss": false,
"oColVis": {
"aiExclude": [0, 10],
"buttonText": " ",
"bRestore": true,
"sAlign": "right"
},
"aoColumnDefs": [{ "bSortable": false, "aTargets": [0]}],
"fnDrawCallback": function (o) {
/* Position the ColVis button as needed */
var nColVis = $('div.ColVis', o.nTableWrapper)[0];
nColVis.style.width = o.oScroll.iBarWidth + "px";
nColVis.style.top = ($('div.dataTables_scroll', o.nTableWrapper).position().top) + "px";
nColVis.style.height = ($('div.dataTables_scrollHead table', o.nTableWrapper).height()) + "px";

}
});

$('#tblSurveyPlanning_length').css("display", "none");





$("#tblwrapper tfoot input").keyup(function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter(this.value, oTable.oApi._fnVisibleToColumnIndex(oTable.fnSettings(), $("#tblwrapper tfoot input").index(this)));
});

/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer
*/
$("tfoot input").each(function (i) {
asInitVals[i] = this.value;
});

$("tfoot input").focus(function () {
if (this.className == "search_init") {
this.className = "";
this.value = "";
}
});

$("tfoot input").blur(function (i) {
if (this.value == "") {
this.className = "search_init";
this.value = asInitVals[$("tfoot input").index(this)];
}
});
});
This discussion has been closed.