Thursday, January 17, 2013

Ribbon menu missing on page load after customisation


After  Customisation in sharepoint pages ribbon menu missing on page load for perticular webpart.

            In sharepoint 2010, if you have more than one webpart on webpart page, the ribbon disappears because SharePoint doesn't know which web part to display ribbon for. This is by design because if you have a document library web part and list web part on the same page, the ribbons are obviously differ for the two and sharepoint needs to know which webpart to display the ribbon for.

To avoid the above problem use the following javascript.

<Script>
setTimeout(function()
{

var obj = document.getElementById("MSOZoneCell_WebPartWPQ3");
if(obj != null)
{

var obj1 = new Array()

obj1["target"] = obj

obj1 ["srcElement"] = obj

WpClick(obj1)
}
},2000)

</Script>

No comments:

Post a Comment