Skip to main content
10 votes
Accepted

$A.enqueueAction is hit, but not executed until another event fires in page (SweetAlerts)

I think this is happening because you are calling the method from outside Aura's normal rendering cycle -hence it works once you force something else to render. Try putting your callback inside this: ...
Caspar Harmer's user avatar
9 votes

How to use apex ids within jquery functions

VF adds to the Ids if not all elements has an id. It will be like jd_0.showmsg So use a Ends With selector as below $("[id$=showmsg]") Did you include jQuery? The following works fine for me: ...
Eric's user avatar
  • 54.2k
9 votes

How to run " $('div').clone().appendTo('.wrapper'); " in LWC?

In LWC, we usually do not create dynamic nodes this way. It is idiomatic in LWC to use a repeating template (for:each and for:item) and only change the data that drives the template, rather than clone ...
sfdcfox's user avatar
  • 497k
8 votes
Accepted

jQueryUi input[inputIndex].hasOwnProperty is not a function

I can confirm this is reproducible. The root cause of the error is jQueryUI executing window.hasOwnProperty("document"). You can see this by opening up chrome debugger and breaking on all exceptions. ...
Ravi Jayaramappa's user avatar
7 votes

jQuery NiceScroll not working when Locker Service is active

When locker service is in place, the golden rule is: you cannot access the DOM of the components you do not own Why this is enforced? It is mainly to preserve the component encapsulation, so that ...
Praveen's user avatar
  • 10.1k
7 votes
Accepted

How do I disable or lock lookup fields on a Visual Force page?

The JQeury doesn't handle the lookup button.. In case it is always disable consider using instead : apx:outputField If it depend on criteria you can add both input & output but show only 1 of ...
Liron C's user avatar
  • 1,788
7 votes
Accepted

Uncaught ReferenceError: jQuery

By using apex:includeScript, the sisyphusf script loading is moved to the beginning of the page: When specified, this component injects a script reference into the element of the generated HTML ...
Keith C's user avatar
  • 136k
6 votes
Accepted

Using jQuery to add numeric values in Apex:repeat

You've got a few problems here. First, "total" isn't the ID of the repeat element in the traditional HTML sense. I'm pretty sure it doesn't even get rendered into the final HTML, so JavaScript can't ...
sfdcfox's user avatar
  • 497k
6 votes
Accepted

Is it possible to call a Lightning Component from a Javascript function?

There is an event named force:navigateToComponent. You can use this event for going to another component. It is currently in the Beta version in the Winter '17 release. Example: var evt = $A.get("e....
Junaid P Khader's user avatar
6 votes
Accepted

jQuery Keyup function not working

You're using JQuery before declaring jQuery.noConflict(); Also, this statement replace the $ variable by jQuery. And finally, as Rahul just said in his answer, Salesforce add a prefix to the ids ...
Martin Lezer's user avatar
  • 7,295
6 votes

jQuery in VisualForce is not working

Any element that starts with apex: will have a "managed Id", which includes some prefixes like "j_0:j_10:j11:...". Since jQuery basically uses document#querySelectorAll, you need to use the "ends-with"...
sfdcfox's user avatar
  • 497k
6 votes
Accepted

Get access to salesforce REST API without user logging in

You'll want to read all about setting up a public REST API. Basically, you create a @RestResource, then enable the class for the Public Site Settings, and then you can call them without being logged ...
sfdcfox's user avatar
  • 497k
5 votes
Accepted

Jquery selector is not working properly in subsequent loads in lightning component

There are a few issues in your example: init is not synchronized in any way with dynamic loading of javascript or rendering which is why <ltng:require afterScriptsLoaded="{!c....
Doug Chasman's user avatar
  • 10.1k
5 votes

How to assign value to a apex variable in visualforce page ,using javascript/jQuery?

You can define actionFunction, it will invoke controller method, and pass parameter from javascript <apex:actionFunction name="jsFunction" action="{!apexMethod}" > <apex:param ...
Vladyslav K's user avatar
  • 2,743
5 votes
Accepted

How to show Columns of Visualforce Page Based on Custom Settings Fields?

Use a Field Set instead. It was designed with this scenario in mind. Working with Field Sets You can use dynamic bindings to display field sets on your Visualforce pages. A field set is a grouping of ...
Adrian Larson's user avatar
  • 151k
5 votes
Accepted

JQuery Treetable in Lightning is not working when navigating from standard pages to page where treetable is implemented

I too faced the same issue here.What's happening here is jquery selector fails to retrieve the DOM element on subsequent load(component definitions are loaded from cache) not sure why, but the same ...
Praveen's user avatar
  • 10.1k
5 votes

$A.enqueueAction() not working with $A.getCallback()

$A.run() has been deprecated for several releases. To respect access checks you need to use $A.getCallback(), which returns a function that closures the current access context. You then need to ...
Kevin Venkiteswaran's user avatar
5 votes
Accepted

Lightning Components: Will jQuery be unusable after Summer'17 and in future releases?

There are two things with Jquery now:- It will work with your components if, carefully DOM selectors are used. Only basic one like changing css, attribute etc. Don't register Events. Second thing ...
Ashwani's user avatar
  • 22.6k
5 votes
Accepted

lightning $A.enqueueAction(action) does not work!

Since helper.sendPerson() is called by jQuery which happens outside of Lightning's execution context. You need to wrap the jQuery's bind function within $A.getCallback() to make it execute within the ...
Praveen's user avatar
  • 10.1k
5 votes
Accepted

CORS whitelisting not working as expected

Ok. I did some research on this and looks like we both interpreted the Salesforce CORS documentation wrongly. Salesforce CORS says that CORS is only for making requests to Supported Salesforce APIs, ...
javanoob's user avatar
  • 8,907
5 votes
Accepted

aura:Iteration / SLDS tabs / JQuery - in a Lightning Component - How to?

You don't need jQuery for such a simple task. Here's an example I wrote up for you just tweaking your code a bit. You can copy-paste this directly into an application to test it yourself. application ...
sfdcfox's user avatar
  • 497k
5 votes
Accepted

Locker Service and Fullcalendar.io

Logan, I just happen to have a sample of Fullcalendar which displays events. But heads up .. it is not locker compatible. even though I have used ( Full Calendar: 3.1.0 & jQuery 2.2.4 ) as ...
Sumuga's user avatar
  • 2,169
5 votes
Accepted

jQuery parseXML() no longer works since Summer '18

LockerService team has been notified of this issue in the Summer 18 release. We have fixed the bug in a patch release. The fix is scheduled to rollout to production starting 5/9/2018 and may be take a ...
Ravi Jayaramappa's user avatar
5 votes
Accepted

Convert JSON string into apex map

Do something like, String jsonInput = '{"New":["Prospect","Open","In Negotiation","Final Negotiation"],"Readoption":["Won"],"Rollover":["Won","Invoiced","Lost"],"Upsell":["In Negotiation","Lost"],"...
Ranga's user avatar
  • 1,722
5 votes
Accepted

LWC is it Possible to Load the JQuery Plugin Datatables in a Lightning Web Component?

SOLVED! Here's how I did it: MyLwc.html <table lwc:dom="manual" class="example-table display" style="width:100%"></table> Query for the table using this.template.querySelector(); ...
Isaac L's user avatar
  • 174
5 votes

How to run " $('div').clone().appendTo('.wrapper'); " in LWC?

You can simply rewrite your jsfiddle jQuery snipper to LWC next way: <template> <div class="container" lwc:dom="manual"></div> <button onclick={onAddNoteButtonClick}>...
Oleh Berehovskyi's user avatar
5 votes

Why does submitting hidden POST form via jQuery in an LWC not open a new browser tab?

LWC is a "managed DOM" framework. That means you can't just go about putting DOM elements wherever you like. If you want to use something like jQuery, you can, but you need to use lwc:dom=&...
sfdcfox's user avatar
  • 497k
4 votes

Removing Search Box From Partner/Community Portal?

As of February 2019, some themes in the Community Builder allow you to hide the search component. Theme > Theme Settings > Hide the global search component in community header Not all themes ...
AvailableName's user avatar
4 votes
Accepted

Adding Error Message to Input Text using javascript/jquery in Visualforce

This is the code that will work with addError methdod account.NumberOfEmployees.addError('You must enter a value.'); this way you can add error message on field level .. Page <apex:page ...
Ratan Paul's user avatar
  • 22.7k
4 votes
Accepted

DOM modification feasibility in lightning

It will cause an issue during security review if you: Modify DOM from your component outside a Renderer: The only modification allowed on Controllers are add/remove/toggle classes using $A.util ...
Vrakmhare's user avatar
  • 304

Only top scored, non community-wiki answers of a minimum length are eligible