You need to sign in to do that
Don't have an account?
Pavan Kumar 862
Show pop up when data changed and closing with out saving in Lightning componenet
I have implimented the custom component where it will have few input componenets and save button.
If user is changed or given data in input componenets and without savibg button if the user tries to navigate to other page by clickig the Back button(Custom Lightining button) i shoud show the alert telling that "unsaved items are availible in page.Please check and go".
Please let me know how to acheie this requirement in lightining components.
If user is changed or given data in input componenets and without savibg button if the user tries to navigate to other page by clickig the Back button(Custom Lightining button) i shoud show the alert telling that "unsaved items are availible in page.Please check and go".
Please let me know how to acheie this requirement in lightining components.
call a controller method when clicking on "Back" button and put an alert message in that method.
Sample code is given below:
For button on Lightning Component. Controller method which will be written in YourcYour componentroller.js
Let me know if this helps :)
Thanks,
Amit Singh.
try below sample code
* create a bolean attribute and make it by default false.
* add a change event event in your all input fields.
if the any field value is add or change then make isChange attribute is true ,
* if user click on the save button then make isChange attribute is false,
* if user click on the back button then check first if the isChange attribute value is false then navigate to other page or it true(means changes are made in any fields ). give a alert error message .
sample code here
i hope it helps you.
Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others ,thanks
http://sfdcmonkey.com