First click in SharePoint List WebPart on wiki pages
Lets say you have a SharePoint wiki page with some content and you added a list WebPart underneath the text. You open the page and want to go into the list settings or add an item or do another operation you can do inside the ribbon.
You will realize the ribbon is not there. First of all you need to click into the list to make the ribbon visible.
There is a simple JavaScript solution.
This snippet selects the first list WebPart and fakes a click on it so the ribbon appears.
You can add this code by code snippet, directly into the source or within a Content Editor WebPart.
You will realize the ribbon is not there. First of all you need to click into the list to make the ribbon visible.
There is a simple JavaScript solution.
1 2 3 4 5 6 7 8 9 10 | window.onload = function(){ var elem = document.getElementById("MSOZoneCell_WebPartWPQ2"); if (elem != null) { var dummyevent = new Array(); dummyevent["target"] = elem; dummyevent["srcElement"] = elem; elem.parentNode.click(); WpClick(dummyevent); } } |
This snippet selects the first list WebPart and fakes a click on it so the ribbon appears.
You can add this code by code snippet, directly into the source or within a Content Editor WebPart.
Comments
Post a Comment