How to hold previous page on fnAddData.

How to hold previous page on fnAddData.

BASUDEBBANERJEEBASUDEBBANERJEE Posts: 13Questions: 4Answers: 0
edited November 2015 in Free community support

Guys I am using a array of data to bind into data table so I choose to iterate through that array and use fnAddData to bind that in the data table. now I want to stay in the previous page from where reloading happening , but data should be updated one. My current code send me back to the page 1. Please help.
Please look at the code segment for your reference . Thanks in advance.
Here [rows] is the collection of data which i blinded in the data table.

 var triggerTableEvents = function (rows, table) {
                if ($.fn.dataTable.isDataTable(table)) {
                    var tbl = $(table).dataTable();
                    tbl.fnClearTable();
                    for (var i = 0; i < rows.length; i++) {
                          tbl.fnAddData($(rows[i]));
                        }

                    }
                else {
                    table = table.dataTable({
                        paging: true,
                       "iDisplayLength": 5,
                        //"aLengthMenu": [[5, 10, 15, 25, -1], [5, 10, 15, 25, "All"]],
                        "bFilter": false,
                        "bInfo": false,
                        "bLengthChange": false,
                        "bSort": false,
                        "bStateSave":true,
                        "order": [[0, "asc"]],
                        
                        columnDefs: [
        { orderable: false, "targets": 3 }
                      ]
                    });
                }
            }        
This discussion has been closed.