Spmodal()

alebuc
Tera Expert

Hi,

I have an embedded widget:

HTML Code:

<a class="btn btn-{{options.color}} m-b" ng-click="c.onWidget('cags-requisito-insert-form')" ng-show="data.hidebutton=='0'">{{data.buttonMsg}}</a>

CSS: 

.btn {
width: 100%;
}

Server script:

data.buttonMsg = gs.getMessage(options.button_text || "Aggiungi Requisito");
data.sid = $sp.getParameter("sys_id");

var hide = "1";

if(data.sid != "" && data.sid != "-1"){
var gx = new GlideRecord("u_richiesta_demand");
if(gx.get(data.sid.toString())){
if(gx.u_stato.toString() == "-1"
|| gx.u_stato.toString() == "0"
|| gx.u_stato.toString() == "14")
hide = "0";
}
//gs.addInfoMessage("hide: " + hide);

}
data.hidebutton = hide;

Client controller:

function(spModal, $scope) {
var c = this;
var sid = $scope.data.sid.toString();
var url = window.location.href;
url = url.toString();

//alert("URL: " + url);
if(url.indexOf("crea_demand") > -1)
url = url.replace("crea_demand", "cags_visualizza_demand");

c.onWidget = function(widgetId, widgetInput) {
spModal.open({
title: 'Inserisci un nuovo Requisito',
buttons: [],
widget: widgetId,
widgetInput: {"table": "u_requisiti_demand","sys_id":"-1", "query":"u_richiesta_demand=" + sid}
}).then(function(){
top.window.location = url;
})
};
}

 

The portal page in attachment 02.PNG has the "Aggiungi requisito" button, from this button I have the embedded widget shown in 01.PNG attachment.

Since in this embedded widget I have a Save button that I want to modify, but I can not find where it is. I already know that sp.modal has the functionality to add buttons, but I want to modify the save button.

Any clue?

Thanks,

Alessio

 

1 ACCEPTED SOLUTION

Hi 

For navigation you can use - $location.url = your_url 

OR 

$window.location.href = "/sp";

 

Check the example below - 

https://serviceportal.io/navigating-multiple-service-portals/

 

Regards,

Omkar Mone

View solution in original post

6 REPLIES 6

Hi 

For navigation you can use - $location.url = your_url 

OR 

$window.location.href = "/sp";

 

Check the example below - 

https://serviceportal.io/navigating-multiple-service-portals/

 

Regards,

Omkar Mone

Omkar Mone
Mega Sage

Hi alebuc,

 

Can you mark correct answer and close this thread for others to refer?

 

Regards,

Omkar Mone