locked
Dynamics CRM 2016/365: In Entity Grid, Javascript to show Loading Image/message during the execution of code(JS function) RRS feed

All replies

  • In the new version of CRM the code needs to be changed

    use the new code below:

    function showJSProcessingMessage(msg){
    parent.document.getElementById('tdAreas').parentElement.style.display = 'none';
    var newdiv = parent.document.createElement('div');
    newdiv.setAttribute('id', 'msgDiv');
    //newdiv.valign = 'middle';
    newdiv.align = 'center';
    newdiv.marginBottom = '5000px';
    var divInnerHTML = "";
    divInnerHTML += "";
    divInnerHTML += "";
    divInnerHTML += "";
    //divInnerHTML += "</br><img alt='' src='/_imgs/AdvFind/progress.gif' height='34px' width='34px'/></br>";
    divInnerHTML += "</br><img alt='' src='https://media.tenor.com/images/672b62d967f8d00d608d22f36c1831db/tenor.gif' height='34px' width='34px'/></br>";
    divInnerHTML += '<b>' + msg + '</b>';
    divInnerHTML += "";
    divInnerHTML += "";
    newdiv.innerHTML = divInnerHTML;
    newdiv.style.color = '#001D72 ';
    newdiv.style.fontSize = '15px';
    newdiv.style.zIndex = '1010';
    newdiv.style.margin = '0 auto';
    newdiv.style.marginTop = '210px';
    newdiv.style.width = '300px';
    newdiv.style.height = '135px';
    newdiv.style.background = '#FFFFFF ';
    newdiv.style.border = "thin solid #000000 ";
    //newdiv.style.width = getBrowserWidth()+'px';
    //newdiv.style.height = getBrowserHeight()+'px';
    newdiv.style.position = 'relative';
    parent.document.body.insertBefore(newdiv, parent.document.body.firstChild);
    parent.document.getElementById('msgDiv').parentElement.style.visibility = 'visibile';

    setTimeout(HideLoadingMessage, 3000); //use it to define ms for disable loading
    }


    function HideLoadingMessage() {
    var fieldElement = document.getElementById("msgDiv");
    if (fieldElement!= null)
    {
    document.getElementById("msgDiv").style.visibility = "hidden";

    else 
    {
    parent.document.getElementById("msgDiv").style.visibility = "hidden";
    }
    parent.document.getElementById('tdAreas').parentElement.style.display = ''; 

    }

    hope this help you


    H.Ben

    Thursday, August 31, 2017 4:18 PM