title: How to keep scroll position when inserting new rows in datatables
body: <p>I'm using DataTables plugin to work with my table.
  I want to set JSON object as a datasource for my table and update the content every time when this object is changed.</p>
  
  <p>To initialize my table I use the following code:</p>
  
  <pre><code>     var obj = [];
  
       // if I make start initialization of the object - the row in a table appears.
       //var obj = [{"Name": "name1", "Id": "id1", "Value":"value1"}];
  
       var table;
  
          $(document).ready(function () {
  
              table = $('#example').dataTable({
                  "sPaginationType": "full_numbers",
              "sScrollY": "250px",
              "aaSorting": [],
              "aaData": obj,
              "aoColumns": [
              { "mDataProp": "Name" },
              { "mDataProp": "Id" },
              { "mDataProp": "Value" }
          ]
          });
      }
      );
  </code></pre>
  
  <p>To update my JSON object:</p>
  
  <pre><code>function updateObject() {
      var response = $.ajax({
          type: "GET",
          datatype: "json",
          url: myURL,
          success: function (result) {
              obj = jQuery.parseJSON(result);
              //table.fnDraw(); - tried this but it doesn't work
          }
      });
  }
  </code></pre>
  
  <p>JSON data which I get from the server:</p>
  
  <pre><code> [{"Name": "name1", "Id": "id1", "Value":"value1"}, 
       {"Name": "name2", "Id": "id2", "Value":"value2"},...]
  </code></pre>
  
  <p>Is it possible to refresh table content after I get new data from the server?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <pre><code>table.fnClearTable();
  table.fnAddData(obj, false);
  table.fnStandingRedraw();
  </code></pre>
  
  <p>After inserting new rows, current page gets lost and current scroll position also. <strong>fnStandingRedraw</strong> method helps to keep page position. But scroll jumps to the first row. Is there any way to calculate current scroll position to make a jump back after updating (<a href="http://datatables.net/docs/Scroller/1.0.1/" rel="nofollow">http://datatables.net/docs/Scroller/1.0.1/</a>) or some other solution?</p>