• Umang Singhal
  • NEWBIE
  • 4 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 7
    Replies
I have a use case where in i need to develop a reusable lightning component but with dynamic fields to display
For eg: the lookup component should display A,B,C fields in one part and
X,Y,Z fields on another part in the same application
how can i achieve this using one component only?

Any help would be appreciated
 
Hello Everyone,

I'm trying to use force:navigateToComponent, but its not working. Here is my code:
<pre>
({
    NavigatetoComp : function(component, event, helper) {
        
        console.log('Enter Here');
        var evt = $A.get("e.force:navigateToComponent");
        console.log('evt'+evt);
        evt.setParams({
            componentDef: "c:MyComponent2",
            //componentAttributes :{ }
        });
       
        evt.fire();
    }
})
</pre>

It throws following error:
User-added image

Can any body tell why is it so?

Thanks In Advance
Aakanksha Singh
Hello everyone,
I need to know how can I perform mass delete operation with the use of checkboxes.
Here is my component.
<pre>
<aura:component implements="force:appHostable" controller="AccountListController">
<aura:attribute name="accounts" type="Account[]"/>
<aura:handler name="init" value="{!this}" action="{!c.getAccount}" />
<ui:button class="slds-button slds-button--destructive" press="{!c.delete}">Delete</ui:button><!--Mass Delete operation-->
<table class="slds-table slds-table--bordered slds-max-medium-table--stacked-horizontal">
            <thead>
                <tr class="slds-text-heading--label ">
                    <th class="slds-is-sortable" scope="col">
                        <ui:inputCheckbox label="" class="check" aura:id="master" click="{!c.checkAll}"/>
                        Action                        
                    </th>
                    <th class="" scope="col">Account Name</th>
                </tr>  
            </thead>
            <tbody>
                <aura:iteration items="{!v.accounts}" var="account">
                    <tr class="slds-hint-parent">
                        <td class="" data-label="Action" style="padding-left:0;">
                            <ui:inputCheckbox label="" class="check" text="{!account.Id}" aura:id="dependent"/>
                        </td>
                        <td class="" data-label="Account Name" style="padding-left:0;">
                            <a href="{! '#/sObject/' + account.Id + '/view'}">{!account.Name}</a>
                        </td>                                 
                    </tr>
                </aura:iteration>
            </tbody>
        </table>
<aura:component>
</pre>
This is the client side controller:
<pre>
getAccount : function(component,event,helper) {
        var action=component.get("c.getAccountList");
        action.setCallback(this, function(a) {
            component.set("v.accounts", a.getReturnValue());
        });
        $A.enqueueAction(action);
    },
checkAll:function(component,event,helper){
        var master= component.find("master");
        var dep= component.find("dependent");
        var val= master.get("v.value");
        if(val==true){
            for(var i=0;i<dep.length;i++){
                dep[i].set("v.value",true);
            }
        }else{
           for(var i=0;i<dep.length;i++){
                dep[i].set("v.value",false);
            }
        }
    },
    delete:function(cmp,evt,helper){}
</pre>
This is the sever side controller:
<pre>
public with sharing class AccountListController {
    @AuraEnabled
    public static List<Account> getAccountList() {
        return [SELECT Id,Name,Accountnumber FROM Account order by CreatedDate desc];
    }       
}
</pre>
Kindly help.
Thanks
Regards
 
Hi everyone,

Can anyone help me in how can I apply pagination To lightning component that is in Aura:iteration records list.

Thanks in advance.
Can anyone please help me to implement pagination using lightning component?
I'm using SLDS in a Lightning component, and I'm sure I've read somewhere that the page header can be made to stay fixed whilst the rest of the screen is vertically scrolled.

My page header looks like this:
<div class="slds-page-header">
    <p class="slds-text-heading--label">Contacts</p>
    <h1>My Contacts</h1>
 </div>

Is there a class that I'm missing?
 
  • September 10, 2015
  • Like
  • 0
I am currently stuck on an issue I am having getting the value of the ui:inputCheckbox Lightning component. In the Lightning Component Developer Guide, the following example is provided:

COMPONENT MARKUP
<aura:component>
    <aura:attribute name="myBool" type="Boolean" default="true"/>
    <ui:inputCheckbox aura:id="checkbox" label="Select?" change="{!c.onCheck}"/>
    <p>Selected:</p>
    <p><ui:outputText class="result" aura:id="checkResult" value="false"/></p>
    <p>The following checkbox uses a component attribute to bind its value.</p>
    <ui:outputCheckbox aura:id="output" value="{!v.myBool}"/>
</aura:component>

COMPONENT CONTROLLER
 
({
        onCheck: function (cmp, event, helper) {
            var checkCmp = cmp.find("checkbox");
            resultCmp = cmp.find("checkResult");
            resultCmp.set("v.value", "" + **checkCmp.get("v.value")**);
        }
    })

I am currently using the exact pattern in my markup as follows:

MY COMPONENT MARKUP
<div class="pbxs">
         <div class="tc wht pas mhauto"></div>
         <ui:inputCheckbox aura:id="taskCheckBox" text="{!nextsteps.task.Id}"  class="sq-25 checkbox checkbox--default checkbox--states-1 brm mrs bg-secondary-btn sq-22 a-mid dib" change="{!c.handleCheckTask}"/>                                        
    </div>
MY COMPONENT CONTROLLER
handleCheckTask : function(cmp, event, helper) {
            var checkCmp = cmp.find("taskCheckBox");
            console.log("value : " + **checkCmp.get("v.value")**)
    }

Strangely, when I click the checkbox in my component, I get the following aura error:
"Uncaught error in markup://ui:change : checkCmp.get is not a function"

I am not sure why I am getting that error when I am using the same pattern as in the example. I tried re-creating the example from the guide. When I did that, I did not get the error. Can anyone see what I might be missing?