Quantcast
Viewing all articles
Browse latest Browse all 82127

How to reload Table with new Data when bServerSide is true

Hi,

I would like to reload the table information with new information which is processed at server side. My code snippet is here,

function InitTable()
{
                 $(document).ready(function() {
		           $('#Table').dataTable( {
		              "bProcessing": true,
                              "bServerSide": true,
                              "sPaginationType": "full_numbers"
                              "sAjaxSource": url,
		              "sScrollY": "350px",
		              "bRetrieve": true,
			      "fnServerData": fnDataTablesPipeline,
			  } );
		} );
}

function ReLoadTableOnClick()
{
                    $.ajax({
				url: url,
			       data: {	type: "3" },
                               success: function(data, textStatus){
                                      var oTable = $('#Table').dataTable();
				      oTable.fnClearTable();
				      oTable.fnAddData(data.aaData); 
			 	      oTable.fnDraw();
                               }
                           });
}


I have added code for "fnDataTablesPipeline" as well. First time request to "InitTable" works great including pipeline pagination but the successive request to "ReLoadTableOnClick" not refresh the table with new information which is coming from server side. It shows the old data itself. Also, I would like to post the server side params like displaylenth for pagination and other params in my second request as well. Please help on this.

thanks

Viewing all articles
Browse latest Browse all 82127

Trending Articles