Getting modal widget to open with onChange in SP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 11:50 AM
Hello everyone!
I wanted to put a disclaimer that I am learning Service Portal so this is a new experience for me, any pointers or suggestions will greatly be appreciated!
I am trying to load a modal widget and need to get it to open onChange from a Select box option in Service Portal. A coworker and I have attempted GlideDialogBox window as well as Sweet Alerts...glideDialogBox works correctly in ITIL view but does not work or pop up in Service Portal. Basically what I'm trying to do is in our Computer Purchase catalog, when one selects Macbook option there would be a pop-up saying to follow MacBook instructions. I inserted my code below as well as the code for the Catalog script and in ITIL view we have the onChange in to our Catalog Client script. Is there a way that we can at least use the $scope to connect to the catalog script in the server script? If not are there any pointers that you guys can give me?
Thank you so much for your help!
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2017 01:35 AM
Hi
Yes in the widget you can listen for changes on the variables of the catalog item like this
$rootScope.$on("field.change", function(evt, parms) {
if (parms.field.variable_name == 'computer') {
//Open your modal window
}
See more details here Embedding widgets in Service Catalog - ServicePortal.io - Service Portal, CMS, and Custom Apps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2018 07:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 12:51 PM
Hi Lars!
Thank you so much for your reply, I will definitely try this out and let you know what happens!