Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default class Approvals extends LightningElement {
- @track pendingApprovalHistories =[
- { Name : "Han Solo", CreatedDate : "test123" }
- ];
- actions = [
- { label: 'Make Decision', name: 'make_decision' },
- ];
- columns = [
- { label: 'Name', fieldName: 'name', sortable: true },
- { label: 'Opportunity Owner', fieldName: 'opportunityOwnerName' },
- { label: 'Relationship Name', fieldName: 'accountName' },
- { label: 'Primary Approver', fieldName: 'ownerName' },
- { label: 'Created Date', fieldName: 'createdDate' },
- {
- type: 'action',
- typeAttributes: { rowActions: this.actions },
- },
- ];
- handleRowAction(event) {
- console.log(JSON.stringify("Hello!"));
- const actionName = event.detail.action.name;
- const row = event.detail.row;
- this.makeDecision(row);
- }
- makeDecision(row) {
- console.log(JSON.stringify("Hello2!"));
- }
- }
- <template>
- <lightning-datatable key-field="id" hide-checkbox-column data={pendingApprovalHistories} columns={columns} onrowaction={handleRowAction}>
- </lightning-datatable>
- </template
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement