Hello,
I am trying to adapt this solution to allow bulk deletion of records from a MySQL-based table. I have multi-row selection and checkbox column enabled. Here is my code:
var rows = formatDataAsObject(table1.selectedRow.data).id;
console.log(rows);
console.log("Beginning bulk user deletion. Please standby.");
var uids = formatDataAsObject(table1.selectedRow.data).id;
function runQuery(i) {
if (i >= uids.length) {
console.log("Finished running all queries");
return;
}
var uidarray = uids[i];
console.log("Running deletion for user id:", uidarray);
stg_MM_delete.trigger({
additionalScope: {
uidarray: uidarray,
},
// You can use the argument to get the data with the onSuccess function
onSuccess: function (uidarray) {
console.log("User" + uidarray + "has been deleted successfully");
runQuery(i + 1);
},
});
}
runQuery(0);
Error message: