Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ({
- init : function(cmp, event, helper) {
- var action = cmp.get("c.initData");
- action.setCallback(this,function(response){
- var state = response.getState();
- if(state === 'SUCCESS') {
- var res = response.getReturnValue();
- console.log(JSON.stringify(res.fields));
- cmp.set('v.columns', res.fields);
- var fetchData = [{
- Id: "/0019000001j9i7b",
- Name: "Aethna Home Products"
- }];
- cmp.set("v.data",fetchData);
- /*cmp.set('v.columns', [
- {"label": "Name", "fieldName": "Id", "type": "url", "typeAttributes": {"label": { "fieldName": "Name" }, "target": "_blank"}}
- ]);
- cmp.set('v.columns', [
- {"editable":true,"fieldName":"Id","type":"url","typeAttributes":"{label :{ fieldName : 'Name'}, target: '_blank'}"}
- ]);*/
- //id field is used for the url link
- //Name field is used as the url name
- }
- });
- $A.enqueueAction(action);
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement