Modal Display Problem

18 views
Skip to first unread message

Roman Gelfand

unread,
May 15, 2019, 5:29:29 PM5/15/19
to Google Apps Script Community
Below, I have a function which iterates through items in array and call GridSelected function for each.  Ultimately there is a call to xmlSyncHttpReq function and then to ajax. In ajax, while pulling data via rest call I am displaying "Loading..." and hiding it upon call completion.  On firefox, I am getting the display.  On Chrome, I am not getting the display.   Also, when debugging in chrome, I am getting the display.  Could anyone point me to a possible issue?  Thanks in advance 



function GetUnEditetItems() {
    var items = dataNode.selectNodes("//Items/Item[(not(@Status) or @Status!=8) and (not(@Loaded) or @Loaded!=1) and @isItemNew=1]");
    if (items.length > 0) {
        alert(getLegendMessage("SaveInProcess"));
        for (var i = 0; i < items.length; i++) {
            ItemsGridSelected(items[i], true);

        }
    }
}


function xmlSyncHttpReq(sURL,xmlSend,doThrow){
try{
var oRet;
GG_XML.ajax(sURL, xmlSend, function (ret) {
oRet = ret;
},true);
return oRet;
}catch(e){
if (doThrow)throw e;
else alert(e.description || e.message);
return false;
}
}

var GG_XML = {
ajax_sync: function (sURL, sendData) {
var oRet;
GG_XML.ajax(sURL, sendData, function (ret) {
oRet = ret;
}, true);
return oRet;
},

ajax: function (sURL, sendData, fn, sync, retDom) {
doLoading();
if (typeof (sendData) == "object" && sendData != null) {
try {
sendData = IsActiveXObject ? sendData.xml : (new XMLSerializer()).serializeToString(sendData);
} catch (e) {
sendData = (new XMLSerializer()).serializeToString(sendData);
}
};
$.ajax({
url: getUniqueSid(sURL),
processData: false,
type: "POST",
data: sendData,
async: !sync,
success: function (response) {
hideLoading();
var ret = GG_XML.checkResponseXML(response);
if (!ret) {
if (fn)fn.call(null, ret);
return;

}
if (ret && ret.nodeName == "Action") {
GG_handleResponseAction(ret, fn);
return;
} else if (ret.nodeName == "Message") {
/*
alert(ret.getAttribute("Description"));
$.msgBox({
content: ret.getAttribute("Description"),
success: function (result) {
if (!sync && fn) fn.call(null, ret);
}
});
*/
if (sync && fn) fn.call(null, ret);
} else if (fn) {
if (retDom) fn.call(null, response);
fn.call(null, ret);
}
},
error: function (response) {
hideLoading();
    //alert(response.statusText);
}
});
},

Roman Gelfand

unread,
May 15, 2019, 5:42:04 PM5/15/19
to Google Apps Script Community
I forgot to attach doloading and hideloading function

function doLoading(str){
try{
if (!str) str = "Processing...";
$(document.body).maskloading("Loading...");
}catch(e){}
}

function hideLoading(){
try{$("#body").unmaskloading();}catch(e){}
}
Reply all
Reply to author
Forward
0 new messages