We need to access the “PieceWriterModel” after the condition has been applied. any attempt to read the data in a callback results in this error “f is not a function”. Any ideas?
PieceWriterModel = skuid.model.getModel(“MMA_Music_Piece_Writer”);
var MusicPieceCondition = PieceWriterModel.getConditionByName(“MMA_Music_PieceId”);
var PieceId = row.Piece__r.Id;
console.log(PieceId);
PieceWriterModel.setCondition(MusicPieceCondition,PieceId);
PieceWriterModel.updateData({callback:function(result){
console.log(PieceWriterModel);
}});
Page 1 / 1
Have you tried the jquery deferred syntax instead? It seems clearer to me:
skuid.$.when(PieceWriterModel.updateData()).then(function(){console.log(PieceWriterModel);});
var PieceWriterModel = skuid.model.getModel("MMA_Music_Piece_Writer");<br>var MusicPieceCondition = PieceWriterModel.getConditionByName("MMA_Music_PieceId");<br>var PieceId = row.Piece__r.Id;<br>console.log(PieceId);<br>PieceWriterModel.setCondition(MusicPieceCondition, PieceId);<br>$.when(PieceWriterModel.updateData())<br> .done(function() {<br> console.log('Success');<br> })<br> .fail(function() {<br> console.log('Error');<br> });
Thanks to you both! Matt, it worked.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.