On click of record in skuid page table , i am calling Apex method via javascript. The Apex class is returning some data in the form of list(lets say related to some XYZ object). How can i display this data in my skuid page?
Is it possible to achieve so?
See the “adoptRows” method in the skuid.model.Model object documentation.
Let’s say that your Apex method returned a list of Accounts, and you want to incorporate these Accounts into a Skuid Model on the Account object. As long as this Model has all of the same fields requested on it via the Page Composer, all you should have to do in JavaScript to add these rows into your Skuid Model is something like this:
var mySkuidModel = skuid.$M(‘Accounts’);
var myAccountRows = MyApexController.GetSomeAccounts();
console.log('Number of Accounts in Model BEFORE adoption: ’ + mySkuidModel.getRows().length);
mySkuidModel.adoptRows(myAccountRows);
console.log('Number of Accounts in Model AFTER adoption: ’ + mySkuidModel.getRows().length);
Thanks Zach!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.