title: Get ajax response inside dataTable()
body: <p>This is my existing code for pagination here I am getting error as <code>roleList</code> is not defined.<br>
  I don't know how to use ajax response inside of <code>dataTable()</code>.What I did wrong?
  I got struck with this part for last 3 days,however I searched for a solution for long time,but couldn't fine one.</p>
  
  <pre><code>function empRoles() {debugger
      table = $('#mydata').DataTable({
          "ajax": {
              "type": 'POST',
              "dataType": 'json',
              "url": '/Admin/getRolesList',
              "dataSrc": function (response) {
                  var roleList = response;
                  console.log(roleList)
              },
              "data": {
                  "json": JSON.stringify(roleList)
              }
  
          },
          "columns": [{
              "data": "sNo"
          }, { 
              "data": "roleName",
              "className": "roleName"
          }, {
              "data": "roleName",
              "render": (data, type, row, meta) =&gt; `
                  &lt;button class="btn edit btn-info" id="edit${row.sNo}"&gt;
                      &lt;i class="fa fa-pencil"&gt;&lt;/i&gt;
                      Edit
                  &lt;/button&gt;
                  &lt;button class="btn update btn-success" id="update${row.sNo}"&gt;
                      &lt;i class="fa fa-floppy-o"&gt;&lt;/i&gt;
                      Update
                  &lt;/button&gt;
                  &lt;button class="btn dlt btn-danger" data-toggle="modal" data-target="#confirm" id="delete${row.sNo}"&gt;
                      &lt;i class="fa fa-trash-o"&gt;&lt;/i&gt;
                      Delete
                  &lt;/button&gt;
              `
              ,
              "sortable": false
          }],
          "createdRow": (row, data, dataIndex) =&gt; {
              $(row).attr("id", "row" + data.sNo);
              $('td:eq(1)', row).attr("id", "name" + data.sNo);
          }
      });
  }
  </code></pre>
  
  <p>Any advice please..</p>