My_Test_Repo/force-app/main/default/aura/AccountController/AccountControllerController.js

23 lines
825 B
JavaScript

({
myAction: function(component, event, helper) {
component.set("v.Columns", [
{ label: "Name", fieldName: "Name", type: "text" },
{ label: "Email", fieldName: "Email", type: "email" },
{ label: "Phone", fieldName: "Phone", type: "phone" }
]);
var action = component.get("c.getContacts");
action.setParams({
recordId: component.get("v.recordId")
});
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
var contacts = response.getReturnValue();
component.set("v.Contacts", contacts);
} else {
// Handle error state here
}
});
$A.enqueueAction(action);
}
})