make fixed Width jquery data table with ajax Data source conditional when no records are there

make fixed Width jquery data table with ajax Data source conditional when no records are there

suvrosuvro Posts: 3Questions: 0Answers: 0
edited October 2013 in General
I am using jquery data table Fixed width pluggin with jax data source.First 4 columns are fixed.My requirement is that if there is no records in the DB,I wont show fixed width grid.It should be normal grid.

I am assigning the total records in hidden field. But unfortunately it is not working when FixedColumns is called.plz help!

"fnServerData": function (sSource, aoData, fnCallback) {


aoData.push({ "name": "CompanyID", "value": MasterRecordID });

$.getJSON(sSource, aoData, function (json) {
fnCallback(json)
if (json != null) {
document.getElementById("hdTot").value = json.iTotalDisplayRecords;
if (json.iTotalDisplayRecords == 0) {
alert('No Record Found');
}
else {
//$("#spGetAll").css('display', 'block')
}
}
else {
alert('Som problem occured');
}

}
);
}

"fnInitComplete": function () {

if (document.getElementById("hdTot").value == "0") {
return;
}
else {

new FixedColumns(oTable, {

"iLeftColumns": 3,
"iLeftWidth": 350
});
}
This discussion has been closed.