-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomAccountList.cmp
101 lines (96 loc) · 5.53 KB
/
CustomAccountList.cmp
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<aura:component controller="AccountsController" implements="flexipage:availableForAllPageTypes,lightning:actionOverride,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:appHostable">
<aura:handler name="init" value="{!this}" action="{!c.loadAccountList}"/>
<aura:attribute name="ListOfAccounts" type="Account[]"/>
<aura:handler event="aura:locationChange" action="{!c.refreshView}" />
<aura:registerEvent name="cmpEvent" type="c:compEventCG"/>
<div class="slds-box slds-theme_default">
<div style="margin-top:10px; float:right; margin-bottom:10px; margin-right:100px">
<button class="slds-button slds-button_brand" type="button" onclick="{!c.CreateNewAccount}">New</button>
<lightning:button label="Delete selected" class="slds-button slds-button_brand" type="Submit" onclick="{!c.deleteSelected}" />
<button class="slds-button slds-button_brand" type="button" onclick="{!c.updateAccSource}">Update Account Source</button>
</div>
<table class="slds-table slds-table--bordered slds-table--cell-buffer" style="margin-top:20px">
<thead>
<tr class="slds-text-title--caps">
<th style="width:3.25rem;" class="slds-text-align--right">
<div class="slds-form-element">
<div class="slds-form-element__control">
<label class="slds-checkbox">
</label>
</div>
</div>
</th>
<th>
<span class="slds-truncate" title="Name">Account Name</span>
</th>
<th>
<span class="slds-truncate" title="Name">Account Number</span>
</th>
<th>
<span class="slds-truncate" title="Name">Account Owner</span>
</th>
<th>
<span class="slds-truncate" title="Name">Account Source</span>
</th>
<th>
<span class="slds-truncate" title="Name">Annual Revenue</span>
</th>
<th>
<span class="slds-truncate" title="Name">Type</span>
</th>
<th>
<span class="slds-truncate" title="Name">Industry</span>
</th>
<th>
<span class="slds-truncate" title="Name">Created By</span>
</th>
</tr>
</thead>
<tbody>
<aura:iteration items="{!v.ListOfAccounts}" var="acc">
<tr>
<td scope="row" class="slds-text-align--right" style="width:3.25rem;">
<div class="slds-form-element">
<div class="slds-form-element__control">
<label class="slds-checkbox">
<ui:inputCheckbox text="{!acc.Id}" aura:id="checkbox" value="" change="{!c.OnChangeInputCheckBox}"/>
<span class="slds-checkbox--faux"></span>
<span class="slds-form-element__label text"></span>
</label>
</div>
</div>
</td>
<td scope="row">
<div class="slds-truncate" title="{!acc.Name}"><a>{!acc.Name}</a></div>
</td>
<td scope="row">
<div class="slds-truncate" title="{!acc.AccountNumber}">{!acc.AccountNumber}</div>
</td>
<td scope="row">
<div class="slds-truncate" title="{!acc.Owner.Name}">{!acc.Owner.Name}</div>
</td>
<td scope="row">
<div class="slds-truncate" title="{!acc.AccountSource}">{!acc.AccountSource}</div>
</td>
<td scope="row">
<div class="slds-truncate" title="{!acc.AnnualRevenue}">{!acc.AnnualRevenue}</div>
</td>
<td scope="row">
<div class="slds-truncate" title="{!acc.Type}">{!acc.Type}</div>
</td>
<td scope="row">
<div class="slds-truncate" title="{!acc.Industry}">{!acc.Industry}</div>
</td>
<td scope="row">
<div class="slds-truncate" title="{!acc.CreatedBy.Name}">{!acc.CreatedBy.Name}</div>
</td>
<td>
<button class="slds-button slds-button_brand" type="button" onclick="{!c.editAccount}" id="{!acc.Id}">Edit</button>
<button class="slds-button slds-button_brand" type="button" onclick="{!c.deleteAccount}" id="{!acc.Id}">Delete</button>
</td>
</tr>
</aura:iteration>
</tbody>
</table>
</div>
</aura:component>