Hot answers tagged

2

You may want to try JSON/Wrapper approach. JSON - You can pass JSON string from your current apex method instead of sending nested maps with simple statement - JSON.serialize( nestedMapWhichIsInReturn );. Wrapper - User wrapper to store all respective maps and send its instance to lightning. However it's also kind of JSON only but you can get some of the ...


2

The equivalent would be lightning:empApi/lightning-emp-api. Instead of asking for updates, it's much easier to listen for updates. If you need a polling mechanism, use setInterval/setTimeout. However, there's almost always a better way to deal with server-side updates, such as event-driven notifications.


2

Don't use for ... in for this, use an Array.prototype method, such as: columnHeadersArray.forEach((value) => { console.log(value); }) // output elements Or columnHeadersArray.map((value) => value.label); // Makes an array of labels Etc. Check out the MDN documentation for the varied methods you can use on an Array or Array-like object. If the object ...


2

You missed some characters in your code (e.g. @). Instead, I'd specify which characters are allowed. For example: var re = new RegExp('[^a-z0-9]','i'); Forbids anything other than letters and numbers. Also, it's rather standard practice to write the regular expression in short form: var re = /[^a-z0-9]/i; The other syntax is really meant for dynamic ...


1

Probably the most common library out in the ecosystem is the FFLib Apex Common produced by Andrew Fawcett at Financial Force. Related: blog post. Or you could use the newish System.Security class methods


1

You should be able to simply clear the values of the attributes linked to the fields that you want to clear in the controller function linked to your new clear button. For the example code above, your clear button could look something like this: <lightning:button class="customButton" label = "Clear" onclick="{!c.clearValues}" ...


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