Monday, September 3, 2012

Script for Hiding Custom button in UI

If user does not want the custom button or Control to appear in the Query mode of the applet

function Applet_InvokeMethod (name, inputPropSet)
{
     if (name == "NewQuery")
     {
          var controlVar = this.FindActiveXControl("Custombutton");
          controlVar.style.visibility="hidden";
     }
     else
     {
          var controlVar = this.FindActiveXControl("Custombutton");
          controlVar.style.visibility="Visible";
     }

}

1 comment:

  1. Great post! Don't forget RefineQuery as well.

    function Applet_InvokeMethod (name, inputPropSet)
    {
    if (name == "NewQuery" || name == "RefineQuery")
    {
    var controlVar = this.FindActiveXControl("Custombutton");
    controlVar.style.visibility="hidden";
    }
    else
    {
    var controlVar = this.FindActiveXControl("Custombutton");
    controlVar.style.visibility="Visible";
    }

    }

    ReplyDelete