Ajax动态JSON JQuery

I am new to jquery and I really need help on a quick bug. Below is the code

success: function(data,status)
var records = [];   
records = JSON.stringify(data);
var newr = JSON.parse(records);
$('#tablegrid').dynatable({
  dataset: {
   records: newr,
   perPageDefault: perpage(25)},
   features: {paginate: true, recordCount:true,sorting:true,search:true}
    });
    var table = $('#tablegrid').data('dynatable');
     table.records.updateFromJson(newr);
      table.dom.update();

When I click on search with text in the search bar, The table updates perfectly using the data in the success function and that is what I want. But when I click on page two , the table clears and it says "Showing 0 of 0 records" (filtered from 107 records). Somehow,the filtering disappears somehow. Could someone please help me???? I have been working on this for hours? :(. The goal is to click on page two and see more filtered results. Again, the goal is click on page 2 to see the filtered results. The problem is that it is not working properly