title: Smart table - angularJs - ajax refresh table
body: <p>I am using the angularjs mudule smart table.</p>
  
  <p>My table has server-side processing and all the data load is located on the server. I want to have a refresh button outside of the table.</p>
  
  <p>This is the function that makes a call to the server and I want to be able to call it manually, but I can't figure out how to retrieve the table state in the my controller.</p>
  
  <pre><code>this.callServer = function callServer(tableState) {
  
          ctrl.isLoading = true;
  
          var pagination = tableState.pagination;
  
          var start = pagination.start || 0;     // This is NOT the page number, but the index of item in the list that you want to use to display the table.
          var number = pagination.number || 10;  // Number of entries showed per page.
  
          service.getPage(start, number, tableState, ctrl.startDateFilter,
                  ctrl.endDateFilter).then(function (result) {
              ctrl.displayed = result.data;
              tableState.pagination.numberOfPages = result.numberOfPages;
              ctrl.isLoading = false;
          });
      };
  </code></pre>
  
  <p>My goal is to have a function like this, How can I get the table state?</p>
  
  <pre><code>    this.refreshTable = function(){
          tableState = getTableState();
          ctrl.callServer(tableState);
      }
  </code></pre>