Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. export default class Approvals extends LightningElement {
  2. @track pendingApprovalHistories =[
  3. { Name : "Han Solo", CreatedDate : "test123" }
  4. ];
  5. actions = [
  6. { label: 'Make Decision', name: 'make_decision' },
  7. ];
  8. columns = [
  9. { label: 'Name', fieldName: 'name', sortable: true },
  10. { label: 'Opportunity Owner', fieldName: 'opportunityOwnerName' },
  11. { label: 'Relationship Name', fieldName: 'accountName' },
  12. { label: 'Primary Approver', fieldName: 'ownerName' },
  13. { label: 'Created Date', fieldName: 'createdDate' },
  14. {
  15. type: 'action',
  16. typeAttributes: { rowActions: this.actions },
  17. },
  18. ];
  19. handleRowAction(event) {
  20. console.log(JSON.stringify("Hello!"));
  21. const actionName = event.detail.action.name;
  22. const row = event.detail.row;
  23. this.makeDecision(row);
  24. }
  25. makeDecision(row) {
  26. console.log(JSON.stringify("Hello2!"));
  27. }
  28. }
  29.  
  30. <template>
  31. <lightning-datatable key-field="id" hide-checkbox-column data={pendingApprovalHistories} columns={columns} onrowaction={handleRowAction}>
  32. </lightning-datatable>
  33. </template
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement