Reloading data table with new parameter values
Reloading data table with new parameter values
8karthik8
Posts: 8Questions: 3Answers: 0
I have a data table that is initialized and loaded on a selection of a dropdown1. Lets say now the Parameter NetworkID is “Mark”
var table1 = $('#table1').DataTable({ dom: "Bfrtip",language: { search: "" },
ajax: "/api/ControllerName/MethodName/" + NetworkID + "/" + AE ,
columns: [
{
"data": "Product",
"width": "Auto",
"render": function (data) {
var productName = '';
for (var i = 0; i < data.length; i++) {
productName = productName + ' ' + data[i].name;
}
return productName;
}
},
//Few More columns here
],
select: true
});
Question??:
I need to reload the data table using new parameters , that should fetch new data(i.e. new product’s) on change event of dropdown2 . Lets say the parameter NetworkID now is “John”
Below is what I tried on dropdown2 event change and it did not work.
$('#table1).DataTable().ajax.reload();
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Duplicate of https://datatables.net/forums/discussion/58782/reloading-data-table-with-new-parameter-values#latest