How to get entire grid data using aoData when using bDeferRender option (client side)

How to get entire grid data using aoData when using bDeferRender option (client side)

bbaranibbarani Posts: 32Questions: 0Answers: 0
edited February 2013 in DataTables 1.9
Hi,

I have implemented a separate excel export functionality by using the data from aoData.

Everything works fine if I don't set the bDeferrender option, else only the visible data is getting exported to excel. Can you please let me know the best way to get all the data in the grid if I use bDeferrender option?
[code]
$(dTable.fnSettings().aoData).each(function () {
$(this.nTr).each(function (c) {
var nTds = $('td', this);
for (var j = 0; j < nTds.length; j++) {
excel.ActiveSheet.Cells(i + 3, j + 1).Value = $(nTds[j]).text();
}
i = i + 1;
});
});[/code]

Thanks,
Barani

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Use fnGetData - it will get the full data array regardless.

    Btw - I'd sternly recommend against using anything from the settings object. It is considered private and might change between releases. Use the public API if possible.

    Allan
  • bbaranibbarani Posts: 32Questions: 0Answers: 0
    edited February 2013
    Thanks for your reply. I have currently created a function like below to get the data and it seems to work fine but is there a way to get just the data from visible column automatically? Right now I manually pass the column length (columnList)..

    [code]
    var data = dTable.fnGetData();
    for(var value=0;value
This discussion has been closed.