Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <aura:attribute name = "AccountList" type="List" />
- <aura:attribute name = "AccountList2" type="Account[]" />
- <aura:attribute name = "AccountList3" type="Account[]" />
- <aura:handler name="init" value="{!this}" action="{!c.doinit}" />
- <table>
- <tr>
- <th class="head">Name</th>
- <th class="head">Case</th>
- <th class="head">IB</th>
- </tr>
- <aura:iteration items="{!v.AccountList}" var="acct"><br/>
- <tr>
- <td class="cell">
- <ui:outputText value="{!acct.Name}" />
- </td>
- <td class="cell">
- <ui:inputCheckbox value="{!acct.CaseSelected}" />
- </td>
- <td class="cell">
- <ui:inputCheckbox value="{!acct.IBSelected}" />
- </td>
- </tr>
- </aura:iteration>
- </table>
- var accountId = component.get('v.recordId');
- var action = component.get('c.getAccountList');
- action.setParams({
- accountId : accountId
- });
- action.setCallback(this, function(response){
- var responseValue = response.getReturnValue();
- console.log('responseValue',responseValue);
- component.set("v.AccountList",responseValue)
- },'SUCCESS' );
- }
- if(acc.ParentId == null){
- List<Account> AccountList2 = new List<Account>([Select Id,Name from Account Where ParentId=:acc.id]);
- List<Account> AccountList3 = new List<Account>([Select Id, Name from Account Where id=: accountId]);
- FinalAccount.addAll(AccountList3);
- FinalAccount.addAll(AccountList2);
- System.Debug(FinalAccount);
- return FinalAccount ;
- }
- else{
- List<Account> AccountList3 = new List<Account>([Select id, name from account where id=:acc.ParentId]);
- List<Account> AccountList2 = new List<Account>([Select Id,Name from Account Where ParentId=:acc.id]);
- List<Account> lstAct = [Select Id,Name from Account Where Parentid=:acc.ParentId];
- FinalAccount.addAll(AccountList3);
- FinalAccount.addAll(lstAct);
- FinalAccount.addAll(AccountList2);
- System.Debug(FinalAccount);
- return FinalAccount ;
- }
- @AuraEnabled
- public String Name {get;set;}
- @AuraEnabled
- public boolean CaseSelected {get;set;}
- @AuraEnabled
- public boolean IBSelected {get;set;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement