You need to sign in to do that
Don't have an account?
LinThaw
Show message with multiple lines using showToast
Hi there,
I want to use showToast and
show message with multiple lines.
I tried as follow but \n is not working well.
Regards,
LinThaw
I want to use showToast and
show message with multiple lines.
I tried as follow but \n is not working well.
({ fireToastEvent : function(component, event, helper) { var toastEvent = $A.get("e.force:showToast"); toastEvent.setParams({ "title": "Title", "message": "This is line 1. \n This is line 2. \n This is line 3.", "type": "success" }); toastEvent.fire(); } })is there any idea?
Regards,
LinThaw
http://sfdcmonkey.com/2018/05/05/multiline-toast-message-lightning-component/
hope it will helps
All Answers
Hi Lin,
Please try <br> insted of \n. This might help else need to Javascript coding.
Thanks,
Gaurav
Skype: gaurav62990
I tried <br> also.
But not going to new line.
Regards,
LinThaw
Hi Lin,
Could you please take a look to this URL (https://salesforce.stackexchange.com/questions/138745/returning-a-string-with-line-break-from-an-apex-method-auraenabled/138752)
Thanks,
Gaurav
I also try that way.
I think line break is not working for message of showToast.
Regards,
LinThaw
http://sfdcmonkey.com/2018/05/05/multiline-toast-message-lightning-component/
hope it will helps
Nice override way.
Regards,
LinThaw
This can also be achieved by this method which will be very simple. Just add the below mentioned code in your component.
Component:
And In the message put "\n" in the place you want new line.
Example.js:
Hope this helps for new Lightning developers.
Thanks,
Madhan