I have an extension that calls a service when user clicks Save or Save and Close. It works on Save. But on Save and Close, the window is closed before the request is completed. How can I make it to wait until the request is completed?
$evt.addEventHandler(item, "save", this.getDelegate(this.onItemSave));
onItemSave = function (ev){
var someData = getMyData();
ServiceSaveMyData(someData)
}
ServiceSaveMyData(data){//code to save data}