How to make fixed Width jquery data table with ajax Data source conditional when no records are ther

How to make fixed Width jquery data table with ajax Data source conditional when no records are ther

suvrosuvro Posts: 3Questions: 0Answers: 0
edited October 2013 in General
I am using jquery data table Fixed width pluggin with ajax 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
});
}

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Please link to a test case showing the issue, as noted in the forum rules.

    Allan
This discussion has been closed.