JSFiddle - React, Tailwind, and code Playground
JavaScript
var table = new Object();
var vops = {
// vendorListTable: null,
initVendorListDatatable: function() {
table = $('#vendorListDatatable').dataTable({
"ajax": {
"url": "/vendor/find-by-property/1?distance=1000",
"dataSrc": ""
},
"columns": [
{"data": "office_name"},
{"data": "distance"}
]
}); /* dataTables */
console.log('datasource is: ' + table.ajax.url()); //does not work
}
changeAjaxURL: function(newDistance) {
table.ajax.url( '/vendor/find-by-property/1?distance=' + newDistance ).load();
}
};
/* I want to get something like the changeAjaxURL function working but I can't seem to get the datatables object It seems. */