You need to sign in to do that
Don't have an account?
Not able to access DOM element of same component using class selector jQuery when Locker Service is Activated
Hi #SalesforceOhana I need urgent help on this, I have gone through the salesforce documents which says that when locker service is activated you will not be able to access elements generated by other components which is far enough :) , but what I am trying to do is to access the element generated by same component but no luck :( when locker service is activated.
Below are the details -
Lightning Application - LS_SampleA
Lightning Component - LS_SampleC
LS_SampleC.css
App Preview -

When user clicks on Color button, text gets colored. This is working only if locker service is deactivated.
When locker service is deactivated -

When locker service is activated -

Thanks in advance
Below are the details -
Lightning Application - LS_SampleA
<aura:application > <c:LS_SampleC></c:LS_SampleC> </aura:application>
Lightning Component - LS_SampleC
<aura:component > <ltng:require scripts="/resource/jquery"/> <ui:outputText aura:id="trialField" class="trialField" value="Lightning Locker Service"/> <ui:button press="{!c.highlighter}" label="Color" /> </aura:component>LS_SampleCController.js
({ highlighter : function(component, event, helper) { debugger; $(".trialField").addClass("color"); } })
LS_SampleC.css
.THIS.color { background-color: #fdd987!important; }
App Preview -
When user clicks on Color button, text gets colored. This is working only if locker service is deactivated.
When locker service is deactivated -
When locker service is activated -
Thanks in advance