I have lightning inspector installed and it is showing me the statistics when I navigate to VF page that contains my lightning component. But, if I click or do some onchange action, it is not giving me statistics. What could be possible reason for that?
[SalesForce] Lightning inspector not working after taking action on components
Related Solutions
Something does not look right in your data binding. You declare an aura:iteration
through v.milestones
and you declare var="mile"
. But all your bindings inside the iteration are pointing to v.milestone.propertyName
when they should be pointing to mile
(no v.
because this variable is internal to the iteration).
So first off I would try correcting that:
<aura:attribute name="milestones" type="Object[]" />
<div aura:id="saveconfirmation"></div>
<aura:iteration items="{!v.milestones}" var="mile" indexVar="index">
<div class="slds-form-element" style="width:180px;">
<ui:inputText label="Milestone Number" value="{!mile.name}" disabled="{!(mile.recordId != '') ? 'true' : 'false'}" class="slds-input" labelClass="slds-form-element__label" change="{!c.updateActionOnChange}"/>
</div>
<div class="slds-form-element" style="white-space: nowrap;width:130px">
<ui:inputDate aura:id="dueDate" label="Due Date" value="{!mile.dueDate}" displayDatePicker="true" class="slds-input" labelClass="slds-form-element__label" blur="{!c.dateOnChange}"/>
</div>
</aura:iteration>
<ui:button label="Save" press="{!c.saveVariationHelper}" class="slds-button slds-button--brand" aura:id="savemilestonebutton" />
Next, in your JavaScript, you declare var milestones = component.get('v.milestones');
but then you repeatedly make reference to milestoneArray
which doesn't exist. I am surprised you are not seeing any console errors!
In my sandbox the fix to object binding in Lightning Locker has already rolled out so if you don't have the fix yet, you will soon. I should advise that any fields that do not already exist in the array's objects may face some binding difficulties. Sometimes I also find that if data objects were passed into the component as a parameter, Locker Service will proxy them before your code ever gets to see them and this can screw up the bindings. So in one of my components I basically had to clone the passed-in object, add necessary fields, and then assign it to a new private attribute that is only used internally.
If you made some errors in the code you posted here, please edit your original post and comment to let me know.
You can try force:refreshView, which reloads all data for the view. So in addition to $A.get("e.force:closeQuickAction").fire();
add $A.get('e.force:refreshView').fire();
in your setCallback method.
({
handleClick : function(component, event, helper) {
var saveLeadAction = component.get("c.leadSave");
saveLeadAction.setCallback(this, function(a) {
if (a.getState() === "SUCCESS") {
$A.get("e.force:closeQuickAction").fire();
$A.get('e.force:refreshView').fire();
}else if (res.getState() === "ERROR") {
console.log("Errore Saving Contact ");
}
});
$A.enqueueAction(saveLeadAction);
}
})
Best Answer
Need to enable debug mode for lightning. After that lightning inspector details can be viewed. Missed the documentation here