Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Lightning Component:
- <aura:attribute name="queues" type="String[]"/>
- <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
- <ul class="list-group">
- <aura:iteration items="{!v.queues}" var="queue">
- <li class="list-group-item">
- <p>{!queue.name}</p>
- <p>Test</p>
- </li>
- </aura:iteration>
- </ul>
- Lightning Controller:
- ({
- doInit : function(component, event) {
- var action = component.get("c.findAll");
- action.setCallback(this, function(a) {
- component.set("v.queues", a.getReturnValue());
- console.log("getreturnvalue" + a.getReturnValue());
- });
- $A.enqueueAction(action);
- }
- Lightning Apex Logic:
- @AuraEnabled
- public static List <String> findAll() {
- List<String> getQueue = new List<String>();
- for (Group gr : [SELECT Id,name FROM Group where Type = 'Queue' LIMIT 10] ){
- getQueue.add (gr.name);
- }
- return getQueue;
- }
Add Comment
Please, Sign In to add comment