You need to sign in to do that
Don't have an account?
abu saleh khan 8
2. Don’t show this checkbox/modal again
Hi all,
I have a requirement to create a lightning component in which I need a modal box with checkbox, which should stop showing up when user select a checkbox.
I have referred many Javascript examples but unfortunately I am not able to figure it out.
Thanks.
I have a requirement to create a lightning component in which I need a modal box with checkbox, which should stop showing up when user select a checkbox.
I have referred many Javascript examples but unfortunately I am not able to figure it out.
Thanks.
Greetings to you!
You can use localStorage 'tempSession'. You need to use init handler so that when component refreshes it should get tempSession. And you need to set its value on button or checkbox click (change according to your requirement). Below is a sample code which might help you. If you click on a button without selecting checkbox it will display modal again on refresh but if you click on a button after selecting a checkbox the modal will not show again for that session.
Below is the sample code. Kindly modify the code as per your requirement.
Component:
Controller:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas