Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3740

The function in replacements of ajax wont be fired

$
0
0

Hi all, excuse me.

I'll appreciated if someone can give me advise.

I cannot get the current DT_RowID after I click the update butten. my api has retrieved the ajax data from the editor, but I still need to process before the ajax data send.

Thanks!

editorList = new $.fn.dataTable.Editor({
ajax: {
edit: {
url: MyApiUrl,
headers: {
Authorization: 'Bearer ' + jsApiToken
},
contentType: "application/json",
method: 'put',
replacements: {
controller: function (key, id, action, data) {
console.log('this function won't be fired after the update button has been click);
return id;
}
},
data: function (d) {
console.log('need to get the DT_RowID before send the ajax data');
return JSON.stringify(d);
}
}
}


Viewing all articles
Browse latest Browse all 3740