1

I have created a WebPart. It consists of some HTML / JavaScript code for filtering a document library and a ListViewByQuery-WebPart for showing the results. Is it possible on this WebPart Page to show the ribbon bar "Documents" as in a standard document library when selecting a document in the results area (ListViewByQuery-WebPart)? I've already googled a lot, but I find only results like this one to blend in the ribbon bar itself:

setTimeout(function () {
    var elem = document.getElementById("MSOZoneCell_WebPartWPQ2");
    if (elem != null) {
                    var dummyevent = new Array();
                    dummyevent["target"] = elem;
                    dummyevent["srcElement"] = elem;
                    WpClick(dummyevent);
    }
}, 2000);

or

var wp = document.getElementById("_wpSelected");
if (wp != null) {
//switch to second webpart (the list)
wp.value = "MSOZoneCell_WebPartWPQ2";
//call the ribbon for this webpart
SelectRibbonTab('Ribbon.Read', true)
}

Or is it possible by using another WebPart for displaying the results? Thanks for any hint.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.