title: DataTables ajax.reload() with parameters
body: <p>I am using DataTables <strong>serverSide</strong> in an Angular2 project.</p>
  
  <p>I am trying to reload the table after making changes, and those changes I want to pass them as parameters in POST via AJAX.</p>
  
  <p>The thing is that DataTables is always getting  the <code>options</code> object from the initialization, and not an updated version with the <strong>new parameters</strong>.</p>
  
  <p>So, <strong>what I need</strong> is, to use <code>ajax.reload()</code> passing a new set of parameters. </p>
  
  <p>This is my current function:</p>
  
  <pre><code>filterData(tableParams) {
      console.log('reloading DT. tableparams received are: ' + JSON.stringify(tableParams));
  
      let element = $(this.el.nativeElement.children[0]);
      let table = element.find('table.dataTable');
      table.DataTable().ajax.reload();
  }
  </code></pre>
  
  <p>At the moment, as you can see, I'm not using <code>tableParams</code>, this is because I wanted to show a clean version of my function, I tried many things and none of them worked.</p>
  
  <p><strong>DataTables always gets the initial <code>options</code> object</strong>, with the initial parameters.</p>
  
  <p>This is one of my desperate attempts:</p>
  
  <pre><code>filterData(tableParams) {
      let element = $(this.el.nativeElement.children[0]);
      let table = element.find('table.dataTable');
      table.DataTable({
          ajax: {
              url: this.jsonApiService.buildURL('/test_getUsers.php'),
              type: 'POST',
              data: tableParams,
          },
      }).ajax.reload();
  }
  </code></pre>
  
  <p>Some help would be much appreciated. If you need further explanations on how the DataTable is created, or more code snippets let me know. But I think that the issue is just with the <code>ajax.reload()</code> function, being able to send updated parameters will solve the issue.</p>
  
  <p>Thanks very much!</p>
  
  <p><strong>Edit 1</strong></p>
  
  <p>This is my init <code>options</code> object:</p>
  
  <pre><code>            let data = {
                  email: true,
                  test: 'init',
              };
  
              this.options = {
                  dom: 'Bfrtip',
                  processing: true,
                  serverSide: true,
                  pageLength: 20,
                  searchDelay: 1200,
                  ajax: {
                      url: this.jsonApiService.buildURL('/test_getUsers.php'),
                      type: 'POST',
                      data: data,
                  },
                  columns: [
                      {data: 'userId'},
                      {data: 'userCode'},
                      {data: 'userName'},
                      {data: 'userRole'},
                      {data: 'userEmail'},
                  ],
              };
  </code></pre>
  
  <p>And these are the parameters that DataTables is sending:</p>
  
  <p><a href="https://i.stack.imgur.com/H43ZV.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/H43ZV.jpg" alt="enter image description here"></a></p>
  
  <p><em>(Among other DataTables parameters)</em></p>
  
  <p>When I call <code>ajax.reload()</code>, no matter the things I have tried, I end up sending these same parameters, therefore, sending the init parameters. </p>