Hidden buttons reappear when resizing a crmForm


In a previous post  I described how to hide custom buttons in a toolbar.
When a CRM form is resized by the user it appear that these hidden buttons will show up again.

To avoid this behaviour you should put your code into a global function and attach this function to the resize event of the window.

Example:

This code should be placed in the onload of the form.

HideButton = function()
{
var ULListItems = document.getElementById(“mnuBar1”).rows[0].cells[0].getElementsByTagName(“UL”)[0].getElementsByTagName(“LI”);
for(var i=0; i -1)
{
ULListItems[i].style.display = “none”;
}
}
}

// Execute the function when loading the form
HideButton();

// Execute the function when the form is resized.
window.onresize = HideButton;

Advertisements
Tagged with: ,
Posted in CRM 4
One comment on “Hidden buttons reappear when resizing a crmForm
  1. Fahmeeda Yaseen says:

    we are facing the same problem bt we cant understand the code so please describe in detail

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: