将1:N关系的界面上"添加现有****"按钮隐藏掉

/* Hide Button */
HideAssociatedViewButton(
'esp_quote_esp_shippingmark''Add existing Shipping Mark to this record');

function HideAssociatedViewButton(loadAreaId, buttonTitle)
{
    
var navElement = document.getElementById('nav_' + loadAreaId);
    
if (navElement != null)
    {
        navElement.onclick 
= function LoadAreaOverride()
        {
            
// Call the original method to launch the navigation link
            loadArea(loadAreaId);
            
            
var associatedViewIFrame = document.getElementById(loadAreaId + 'Frame');
            
if (associatedViewIFrame != null)
            {

                associatedViewIFrame.onreadystatechange 
= function HideTitledButton()
                {
                    
if (associatedViewIFrame.readyState == 'complete')
                    {
                
                        
var iFrame = frames[window.event.srcElement.id];
                        
var liElements = iFrame.document.getElementsByTagName('li');
                        
for (var i = 0; i < liElements.length; i++)
                        {
                            
                            
if (liElements[i].getAttribute('title'== buttonTitle)
                            {
                                liElements[i].style.display 
= 'none';
                                
break;
                            }
                        }
                    }
                }
            }
        }
    }
}
原文地址:https://www.cnblogs.com/janmson/p/1445991.html