I use jquery DataTables 1.10.0 to display some data on a table. This is how I load the data:
var layer_data = $("#layer_data").DataTable({
"scrollX": true,
"aaData":whole_array,
"iDisplayLength": 10
});
Where the whole_array is a an array of arrays as:
[Array[7], Array[7], Array[7]
Each array has different values as:
0:"<button id="1" class="btn btn-info btn-sm _edit_save_btn" style="margin-bottom:5px;width:68px; background-color:#a7a3a3;border-color:#a7a3a3">Edit</button></br><button id="fid__1" class="btn btn-info btn-sm _add_save_btn" data-toggle="modal" data-target="#add_geometry" data-fid="afghanistan_test.1" style="background-color:#a7a3a3; border-color:#a7a3a3;margin-bottom:5px;width:68px;">Geometry</button></br><button id="fid__cancel__1" class="btn btn-info btn-sm _cancel_btn" style="margin-bottom:5px;width:68px; background-color:#a7a3a3;border-color:#a7a3a3">Cancel</button>"
1:"Afghanistan"
2:"Badakhshan"
3:...
What I want to do is to redraw/refresh the table on a button click. I read there are ways to do this with ajax requests but I think this is not my case as the data come from a django view which is initialized on page load.