The upvoted answer is fine but I think the nicer and more "dynamic" way to do it would be inside an event trigger.
window.addEventListener('load', function() {
var dynaTable = $("#dynatable-table");
//you can call your function within the "function (e,data)"
// or replace it
dynaTable.bind('dynatable:beforeProcess', function (e, data) {
console.log("beforeProcess fired",data);
var dynaTableData = dynaTable.data('dynatable');
if(!dynaTableData){
; //not yet loaded
}else{
//add aditional ajax params here
dynaTableData.settings.dataset["ajaxData"] = { "addedDateTime" : new Date()};
}
});
dynaTable.bind('dynatable:afterProcess', function (e, data) {
//after adding the additional ajax params you should be able to
// see them here
console.log("afterProcess fired",data);
});
dynaTable.dynatable({
dataset:{
ajax: true,
ajaxUrl: appRootUrl + "/projects/getSomeRecords",
ajaxOnLoad: true,
records: []
},
features:{
pushState : false
}
});
Sometimes you might need to force Dynatable to update, this can be done easily:
self.forceDynaTableUpdate = function () {
var dyna = $('#dynatable-table-sessions').data('dynatable');
if(!dyna){
return;
}
console.log("dyna setting:",dyna.settings);
dyna.process(true);
};