Portal - display popup window on a button click

Supriya More
Kilo Contributor

How to create a pop up window in portal which opens up on click of a button?

1 ACCEPTED SOLUTION

Shubham Tipnis
Kilo Sage
Kilo Sage

Hi Surpiya,

 

Please refer below reference url which explains the spModal class which is essentially what you need. Apart from this, you can also add modal popups using bootstrap classes.

https://developer.servicenow.com/dev.do#!/reference/api/quebec/client/SPModal-API

 

Code example:

 

// HTML template 
<button ng-click="c.onAlert()" class="btn btn-default">
    Alert
  </button>

// Client script
function(spModal) {
    var c = this;
  c.onAlert = function () {
        spModal.alert('How do you feel today?').then(function (answer) {
            c.simple = answer;
        });
    }
 }

 

Please mark correct/helpful if applicable.

 

Regards,

Shubham

Regards,
Shubham Tipnis
 ServiceNow Enthusiast
️ 3x Rising Star (2022–2024) – ServiceNow Community
 Sharing insights, use cases & real-world learnings from the Now Platform
 Always learning. Always building.

View solution in original post

2 REPLIES 2

Shubham Tipnis
Kilo Sage
Kilo Sage

Hi Surpiya,

 

Please refer below reference url which explains the spModal class which is essentially what you need. Apart from this, you can also add modal popups using bootstrap classes.

https://developer.servicenow.com/dev.do#!/reference/api/quebec/client/SPModal-API

 

Code example:

 

// HTML template 
<button ng-click="c.onAlert()" class="btn btn-default">
    Alert
  </button>

// Client script
function(spModal) {
    var c = this;
  c.onAlert = function () {
        spModal.alert('How do you feel today?').then(function (answer) {
            c.simple = answer;
        });
    }
 }

 

Please mark correct/helpful if applicable.

 

Regards,

Shubham

Regards,
Shubham Tipnis
 ServiceNow Enthusiast
️ 3x Rising Star (2022–2024) – ServiceNow Community
 Sharing insights, use cases & real-world learnings from the Now Platform
 Always learning. Always building.

Hi,

 

Thank you for the quick response.

 

Regards,

Supriya