issue with fnStateSave tableProperty

issue with fnStateSave tableProperty

vamvam Posts: 5Questions: 0Answers: 0
edited March 2014 in Bug reports
Hi,

Am facing problem with fnStateSave property .

In My table Grid there is 60+column and when am trying to get the table property using fnStateSave it reset all the filter and return default table property.

But when am trying to do the same with less number of column it work fine. its return table properties with all filter and sort.


for reference
[code]
var tableProperty;
$('#biReportTable').dataTable({
"bDestroy" : true,
"bStateSave" : true,
"bDeferRender" : true,
"bSortClasses" : false,
"sScrollX" : "100%",
"bLengthChange" : false,
"iDisplayLength" : 100,
"sDom" : 'Tlfrtip',
"oTableTools" : {
"aButtons" : ["copy", "csv", "xls", "print"],
"sSwfPath" : "/includes/dataTables/extras/TableTools/media/swf/copy_csv_xls.swf"
},
"fnStateSave" : function (oSettings, oData) {
tableProperty = JSON.stringify(oData);
}
});
[/code]

So how can i resolve this issue. Please help to do this.

Thanks in advance

Replies

  • allanallan Posts: 61,625Questions: 1Answers: 10,090 Site admin
    You don't have a state load function that will read the saved data back. So DataTables can never see the data you saved into `tableProperty` . You need to use fnStateLoad as well.

    Allan
  • vamvam Posts: 5Questions: 0Answers: 0
    Hi Allan,

    Thanks for your valuable response.

    I have add this

    [code]
    "fnStateLoad" : function (oSettings) {
    if (typeof tableProperty != 'undefined') {
    console.log(tableProperty);
    return tableProperty;
    } else {
    return false;
    }
    }
    [/code]

    But still no luck.
    It depend on number of column in dataTable? Because its working fine with few number of column.

    Thanks
  • allanallan Posts: 61,625Questions: 1Answers: 10,090 Site admin
    The cookie based state saving will be effects but he number of columns, since a cookie can only be 4KiB in size, however, storing it in a local variable, that shouldn't be an issue.

    Can you link me to a page showing the problem please?

    Allan
  • vamvam Posts: 5Questions: 0Answers: 0
    Hi Allan,

    Thanks
This discussion has been closed.