Show confirm modal on load of the widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 05:49 AM
Hi folks,
I am trying to show a confirm modal before displaying the table lost widget. From the header menu when the user clicks on the menu option...the list view appears, but before that I want to show a confirm box and ask the user to accept terms to view the information. I am able to show the confirm box ,but I need to show the confirm modal !
Is there a say we can call the modal function onload of the widget? How can I call this client script function on load of the widget
client script function -
c.onConfirm = function() {
c.confirmed = "asking";
spModal.confirm("Can you confirm or deny this?").then(function(confirmed) {
c.confirmed = confirmed; // true or false
})
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 07:57 AM
Unchecked but I think it is as easy as calling the function in your client script:
c.confirm();
c.onConfirm = function() {
c.confirmed = "asking";
spModal.confirm("Can you confirm or deny this?").then(function(confirmed) {
c.confirmed = confirmed; // true or false
})
}
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 01:51 AM
Hi Peter , Thanks for your response , i wanted to call this client function onload of widget in html , I was able to achieve that using the ng-init directive