title: Loading data array into datatables using ajax
body: <p>I am trying to load following array into datatables,</p>
  
  <pre><code>  var array=  {
          "rowNumber": 2,
          "mailingID": 3,
          "firstname": "Bruce",
          "lastname": "Ballister",
          "organization": "Apalachee Regional Planning Council",
          "address1": "20776 Central Avenue East",
          "address2": "Suite 1",
          "city": "Blountstown",
          "state": "FL",
          "zip": 32424
        }
  </code></pre>
  
  <p>But, the table is not loading the array into datatable. Also, i can see the array has been received into browser's "response" tab. I think I am missing something in it.</p>
  
  <p>My code:</p>
  
  <pre><code>$.ajax({
              type : "POST",
              url : "getLabels.jsp",
              data : "mailingID=" + selectedValue, // posCodeSelected
              success : function(data) {
               var array= data;
               $(document).ready(function() {
                      $('#printIDs').dataTable( {
                          "ajax": array, /* i think change is needed here*/
                          "columns": [
                              { "data": "rowNumber" },
                              { "data": "mailingID" },
                              { "data": "firstname" },
                              { "data": "lastname" },
                              { "data": "organization" },
                              { "data": "address1" },
                              { "data": "address2" },
                              { "data": "address3" },
                              { "data": "address4" },
                              { "data": "city" },
                              { "data": "state" },
                              { "data": "zip" }
  
                          ]
                      } );
                  } );
  
              },
              error : function(response) {
                  var responseTextObject = jQuery
                          .parseJSON(response.responseText);
              }
          });
  </code></pre>
  
  <p>Fiddle link : <a href="http://jsfiddle.net/kpqru5hm/" rel="nofollow">http://jsfiddle.net/kpqru5hm/</a></p>