I have a JS mass action that works great, I call updateData() inside of a save callback. If I leave the updateData() as is, it works fine. However if I change updateData() into a callback, i get an error that: Uncaught TypeError: object is not a function. here’s my code:
var params = arguments[0];var $ = skuid.$;
var records = skuid.$.map(arguments[0].list.getSelectedItems(),function(item){
return item.row.Id;
});
var EDIHistory = params.model;
//notify user of progress
$.blockUI({
message:‘Resubmitting’
});
for (var n in records) {
var row = EDIHistory.getRowById(records[n]);
EDIHistory.updateRow(row, ‘Manually_Resubmit__c’, ‘true’);
}
//save the model and wait for success
EDIHistory.save({callback:function(result){
if (result.totalsuccess){
// update the data
EDIHistory.updateData({callback:function(result){
if (result.totalsuccess){
$.unblockUI();
}
}});
}
else{
alert(“Something went wrong!”);
}
}});
Is there something wrong with the placement of the “$.umblockUI()”? What is the issue here?
Question
Uncaught TypeError: object is not a function
This topic has been closed for replies.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
