-
Notifications
You must be signed in to change notification settings - Fork 93
/
Copy pathContactDatatableController.js
43 lines (43 loc) · 1.49 KB
/
ContactDatatableController.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
({
handleRowAction: function (component, event, helper) {
let action = event.getParam('action');
let row = event.getParam('row');
switch (action.name) {
case 'clear_address':
helper.clearMailingAddressWithLightningDataService(component, row);
break;
case 'view_cases':
helper.openViewCasesModal(component, row);
break;
}
},
handleOpenUpdateAddressModal: function (component, event, helper) {
let selectedArr = component.find('searchTable').getSelectedRows();
if ($A.util.isEmpty(selectedArr)) {
helper.messageService(component).notifyInfo('Please choose at least one Contact.');
} else {
const dialogServicePayload = {
method: 'modal',
config: {
auraId: 'update-address-modal',
headerLabel: 'Update Address: ' + selectedArr.length + ' Row(s)',
component: 'c:ContactAddressForm',
componentParams: {
contactList: selectedArr
},
mainActionReference: 'c.handleUpdateMultiAddress',
mainActionLabel: 'Update'
}
};
helper.messageService(component).dialogService(dialogServicePayload);
}
},
handleAccountSelected: function (component, event, helper) {
let value = event.getParam('value');
let accountId = (value.accountId)? value.accountId:value;
helper.loadContactTable(component, accountId);
},
handleClearTable: function (component, event, helper) {
component.set('v.tableData', null);
}
});