• Aabhi Batta
  • NEWBIE
  • 134 Points
  • Member since 2015

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 10
    Replies
Dear all,

The Lightning Component reference contains a component called "force:recordEdit" which allows the developer to put en edit page for a record in place. However, it is unstyled and ugly. Is there best practice guidance on how/whether it is supposed to be wrapped in particular divs/classes, etc?

If I inspect the individual input fields / labels / markup etc. that gets rendered, I can see that a lot of the usual CSS classes are included, but don't seem to be having an effect on how the field is rendered.

A field in force:recordEdit looks like this:
User-added image

I'd like it to look like this:
User-added image

I've tried wrapping it in the SLDS class, but the classes in the force:recordEdit component don't seem to exist in SLDS, so that can't be the right source.

Any help appreciated.
Andy
 
Hi,

I have developed an app using lightning components. I have 5 apex server calls in the init function of its JS controller.
But some time my app is not loading fine. Some time it is loading correctly. I have given the '$A.enqueueAction' of all server calls at last part after all server calls in the init fnction. Is there any order in giving the '$A.enqueueAction' of each server calls if there are multiple APEX server calls in single function?

Thankyou
  • July 28, 2016
  • Like
  • 0

Is there any way to remove save and cancel shown in the modal popupof lightning screen?. Ive created a custom button and added to the contact. I'd prefer using the send button in visual force page rather than button present in the modal popup which shows up by default.User-added image
Dear all,

The Lightning Component reference contains a component called "force:recordEdit" which allows the developer to put en edit page for a record in place. However, it is unstyled and ugly. Is there best practice guidance on how/whether it is supposed to be wrapped in particular divs/classes, etc?

If I inspect the individual input fields / labels / markup etc. that gets rendered, I can see that a lot of the usual CSS classes are included, but don't seem to be having an effect on how the field is rendered.

A field in force:recordEdit looks like this:
User-added image

I'd like it to look like this:
User-added image

I've tried wrapping it in the SLDS class, but the classes in the force:recordEdit component don't seem to exist in SLDS, so that can't be the right source.

Any help appreciated.
Andy
 
Hi,

I need to call an apex server function in lightning in every 10 seconds.Is there anyway to achieve this?

Thank you
  • August 08, 2016
  • Like
  • 0
I have 2 lightning components :
the first display a list of articles, for each article there is a button that redirect to the other component that display some information about the selected article. 

Here is a part of the first component :
<aura:attribute name="recordId" type="Id" />

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="wrappers" type="ListeArticlesWrapper" />
<aura:attribute name="articles" type="Article__c" />

<aura:attribute name="Detail" type="String"/>
<aura:registerEvent name="navigate" type="c:NavigateToDetail"/>

<div class="page">
    <h1>Liste des articles</h1>
    <div class="slds">
        <table class="slds-table slds-table--bordered slds-table--cell-buffer">
            <thead>
                <tr class="slds-text-heading--label">
                    <th scope="col" class="head"></th>
                    <th scope="col" class="head">Nom</th>
                    <th scope="col" class="head">Type</th>
                    <th scope="col" class="head">Prix</th>
                    <th scope="col" class="head"></th>
                </tr>
            </thead>
            <tbody>
                <aura:iteration items="{!v.wrappers}" var="wrap">
                    <tr>
                        <td class="cell">
                            <ui:inputCheckbox value="{!wrap.selected}" />
                        </td>
                        <td class="cell">
                           <ui:outputText value="{!wrap.art.Name}" />
                        </td>
                        <td class="cell">
                            <ui:outputText value="{!wrap.art.Type__c}" />
                        </td>
                        <td class="cell">
                            <ui:outputText value="{!wrap.art.Prix__c}" />
                        </td>
                        <td class="cell">
                            <button class="slds-button slds-button--neutral slds-not-selected" 
                                    onclick="{!c.getDetail}" data-recId="{!wrap.art.Id}">Details</button>
                        </td>
                    </tr>
                </aura:iteration>
            </tbody>
        </table>

Ant the associated controller
doInit : function(component, event, helper) {
    helper.init(component, event);
},

getArticles : function(component, event, helper) {
    helper.getArticles(component, event);
},

getDetail : function(component, event, helper){
    var id = event.target.getAttribute("data-recId");

    var article = component.get("v.article");

    var evt = $A.get("e.c:NavigateToDetail");
    evt.setParams({
        "detail": article
    });
    evt.fire();
}

The getDetail retrieve the id of the article correctly, so I think it's ok for it.
Here is the second component (that display the detail) :
<aura:attribute name="item" type="Article__c"/>

    <aura:handler event="c:NavigateToDetail" action="{!c.handleAfficherDetail}"/>
    <div class="name">Nom : {!v.item.Name}</div>
    <ui:button label="Framework Button" press="{!c.handleAfficherDetail}"/>

    <div class="slds">
            <table class="slds-table slds-table--bordered slds-table--cell-buffer">
                <thead>
                    <tr class="slds-text-heading--label">
                        <th class="head">Name</th>
                        <th class="head">Type</th>
                        <th class="head">Prix</th>
                    </tr>
                </thead>
                <tbody>
                        <tr>
                            <td class="cell">
                                <ui:outputText value="{!v.item.Name}" />
                            </td>
                            <td class="cell">
                                <ui:outputText value="{!v.item.Type__c}" />
                            </td>
                            <td class="cell">
                                <ui:outputText value="{!v.item.Prix__c}" />
                            </td>
                        </tr>
                </tbody>
            </table>
        </div>

And its controller :
({
    handleAfficherDetail : function(component, event, helper) {

        var product = event.getParam("detail");
        console.log(product);

        var item = component.get("v.item");

        component.set("v.item", item);
    },
})

The problem is that the second component only display an empty table, without the data. Moreover, the console.log in this controller display nothing, like if the controller was never triggered.

Do you have any idea of how I can fix that ?
  • August 05, 2016
  • Like
  • 0
Hi,

I have developed an app using lightning components. I have 5 apex server calls in the init function of its JS controller.
But some time my app is not loading fine. Some time it is loading correctly. I have given the '$A.enqueueAction' of all server calls at last part after all server calls in the init fnction. Is there any order in giving the '$A.enqueueAction' of each server calls if there are multiple APEX server calls in single function?

Thankyou
  • July 28, 2016
  • Like
  • 0
I have a component, that based on a boolean, displays the proper records
<c:Items completed="false"/>
<c:Items completed="true"/>
I have a press lightning event that updates the record on the page.User-added image
When I refresh the page, the item goes to the completed list.
User-added image
How do I make this item go to the other component without refreshing the page? 
Hi,

1. We have created a lightning component and lightning application.
2. Referred lightning app in visualforce page to display the table of records.

When we are displaying the bulk records (more than 500), it is taking more time (>30 Sec)  due to huge logic in the javaScript helper.

Instead of displaying all the 500 records at a time which is consuming more time, I want to load 5 records first later it can process for the remaining records.

If anyone of you having suggestions please let me know.

Thanks,
Srinivas
 
I can't seem to find any examples where I want to include fields in my query from the Lead table and the related Account table where the ConvertedAccountId matches.  I have tried writing queries but nothing is working.  Isn't this possible?  I can do two queries but I want to only do one and include some fields found in each table.
  • February 24, 2016
  • Like
  • 0