New answers tagged javascript
1
vote
How can I test that my component, which implements the standard modal components, is working properly?
@TemporaryFix's solution works, but following the docs for lightning-modal, we should use a slightly different approach. You're meant to use these methods on the modal.js stub for selecting DOM ...
0
votes
LWC CSP script-src self error
I ran into a similar issue (doing this from within a modal).
My fix was to use event.preventDefault();. So your method would look something like:
setSelectedStage (event) {
this.selectedStage = ...
2
votes
Accepted
How to clear LWC lightning-textarea in javascript
this.template.querySelector('lightning-textarea').value = '';
This should work, if you have one lightning-textarea. If you have several, it affects the first found.
But querySelector fell out of ...
0
votes
Wrap LWC in Aura so it can be opened on click of a button in a pop-up window
Aura is visually very similar to LWC. You have a top-level component, and you'll have your LWC component in the markup.
<aura:component implements="force:hasRecordId,flexipage:...
1
vote
Why Salesforce doesn't provide router for Lightning Component(LWC, Aura)?
Salesforce doesn't provide a built-in router for Lightning Components (both Aura and Lightning Web Components) similar to what is available in some other web frameworks.
However, you can implement ...
2
votes
Accepted
Trouble loading PDF.js lib in LWC
When you do loadScript you need to point it to the .js file in your static resource, not just the folder name.
For example, instead of loadScript(this, pdfjs), you need to do loadScript(this, pdfjs + &...
2
votes
Accepted
How to remove the row from a lightning data table
That code is just wiping out the table data entirely. Instead, you will want to use Array.prototype.splice with exactly two parameters, the index to start at, and the number of elements to delete (1). ...
0
votes
How to set default picklist value for lightning-combobox?
To set the default value of the lightning-combobox as the first picklist value, you need to modify your JS code slightly. You need to assign the value property of the combobox to the value property of ...
1
vote
Issue embedding link in custom label in LWC
To display the HTML link you need to use lightning-formatted-rich-text component as below.
<lightning-formatted-rich-text class="myClass" value={errorText}></lightning-formatted-...
0
votes
Ajax Toolkit remoteFunction Returns Timeout and Page not Found errors
External calls must be done via APEX for security reasons.
Top 50 recent answers are included
Related Tags
javascript × 5556visualforce × 1623
lightning-web-components × 1305
apex × 1133
lightning-aura-components × 921
lightning × 549
custom-button × 330
jquery × 287
html × 263
marketing-cloud × 208
aura × 152
javascript-remoting × 137
css × 130
community × 106
controller × 101
javascript-controller × 96
json × 84
static-resources × 83
lightning-experience × 80
button × 78
ssjs × 76
locker-service × 76
ampscript × 75
lightning-datatable × 73
visualforce-component × 70