Need to remove Close(X) button from spmodal and user need to acknowledge the popup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 01:32 AM
I created a onload catalog client script with the following script
function onLoad() {
spModal.open({
title: 'Test.',
message: "ACknowledge before proceeding",
size: "md",
buttons: [
{label:'I Acknowledge', primary: true},
//{label:'Cancel', primary: false}
]
}).then(function(ans){
if (ans.label == "I Acknowledge"){
//alert('party');
}
});
}
This is how the popup comes up onform load.
I need to remove close button(x) which is at right corner and if i click on escape key the popup gets closed need to restrict that. Because before proceeding with catalog item user needs to acknowledge and order the catalog item
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 02:08 AM
Add this to your onLoad:
angular.element('.dismiss-notifications').css({display:'none'});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 03:13 AM
this isnt working in catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 04:00 AM
Other option is to use uiModal:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 04:35 AM
Hi willem,
the problem is im not using the code in widget, im using that in catalog client script i dont think uimodal will work in catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 09:41 AM
Not the prettiest but works:
function onLoad() {
spModal.open({
title: 'Test.',
message: "Acknowledge before proceeding",
backdrop: 'static',
size: "md",
buttons: [
{label:'I Acknowledge', primary: true},
]
}).then(function(ans){
if (ans.label == "I Acknowledge"){
//alert('party');
}
});
var checkExist = setInterval(function() {
if (top.document.getElementsByClassName('close pull-right')[0]) {
clearInterval(checkExist);
var x = top.document.getElementsByClassName('close pull-right')[0];
x.style.display = "none";
}
}, 100); // check every 100ms
}
Please mark as Correct and helpful. Took a lot of time😂