Sunday, July 29, 2012

Display Lists from Other Site Collection/Web Application Using JQuery

Another frequent requirement is to display Lists/Libraries from Root site to Sub-site or Sub-site to Root site, and in some cases from Cross Site collection. While this can be fulfilled by Web Services, Custom Web Parts, etc, here is the simple JQuery method to display SharePoint list from another site collection or from different site.

I deployed the JQuery file to my WFEs and referred it in the script:
<script type="text/javascript" src="/_layouts/jquery/jquery.min.js"></script>

<!-- placeholder for processing Image and List View -->
<div id="ListViewPlaceHolder"><img src="/_layouts/images/GEARS_AN.GIF" alt="" /></div>
 
<script type="text/javascript">
<!-- Specify the View URL of the list you want to show: -->

var ShowWP = "https://portal.crescent.com/clients/mcdonald/Lists/ClientNotes/AllItems.aspx";
$("#ListViewPlaceHolder").load(ShowWP +" #WebPartWPQ2 .ms-listviewtable",function() {
    $("#ListViewPlaceHolder *").removeAttr("id onclick onfocus onmouseover");
});

</script>

SharePoint User Toolkit  at http://usermanagedsolutions.com/SharePoint-User-Toolkit/Pages/Cross-Site-List-Snapshot.aspx provides UI to Generate the script. Just enter your List URL and get the Javascript, place it in CEWP or wherever applicable.
 sharepoint display list from another site collection

By the way, SharePoint User Toolkit offers few more such features like Image Rotators, Tabs, etc.



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

1 comment :

  1. yes, your solution is ok, but i want display list like the gantt.your solution display list if list view is html but if list view gantt. your solution works? can you help me

    ReplyDelete

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...