Pages

Monday, 22 August 2011

Sharepoint 2010 Calendar View All the events Expanded

By Default SharePoint shows 3 events for any date in the calendar view, if we want to show all the events then we have to use any of the following script for the same.

1)---
<script type="text/javascript">

_spBodyOnLoadFunctionNames.push("myFuncAfterLoad");

function myFuncAfterLoad() {
    var oldCalendarNotify4a = SP.UI.ApplicationPages.CalendarNotify.$4a;

    SP.UI.ApplicationPages.CalendarNotify.$4a = function () {
        oldCalendarNotify4a();
        myFuncToExpandCalendar();
    }
}

function myFuncToExpandCalendar() {
    try {
        var aTags = document.getElementsByTagName('A');
        for (i = 0; i < aTags.length; i++) {

            if ((aTags[i].evtid == "expand_collapse") && (aTags[i].innerText != "collapse")) {
                (aTags[i]).click();
            }
        }
    }
    catch (err) {
        alert(err.message);
    }
}

</script>

******************************************************************
2)
<script type="text/javascript">

_spBodyOnLoadFunctionNames.push("myFuncafterLoad");
function myFuncafterLoad(){var OldCalendarNotify4a = SP.UI.ApplicationPages.CalendarNotify.$4a;SP.UI.ApplicationPages.CalendarNotify.$4a = function (){myFunctoExpandCalendar();OldCalendarNotify4a();}}
function myFunctoExpandCalendar(){try{var aTags=document.getElementsByTagName('A');for(i=0;i<aTags.length;i++){try{if(aTags[i].evtid=="expand_collapse"){aTags[i].click();break;}}catch(err){ alert('Bad Call at' + aTags[i].href);}}}catch(err){alert(err.message);}}</script>

*********************************************************************

3)
<script type="text/javascript">

_spBodyOnLoadFunctionNames.push('WaitForCalendarToLoad');
function WaitForCalendarToLoad()
{  
    SP.UI.ApplicationPages.SummaryItemRenderer.prototype.$2u = function ()
    {
            ULSvSp: ;
            if (!this.$1A_1) this.$1A_1 = 100;
            return this.$1A_1
        }
}</script>

*******************************************************************

4)
<script type="text/javascript">

 _spBodyOnLoadFunctionNames.push('WaitForCalendarToLoad');
function WaitForCalendarToLoad()
{  
    var old$4a = SP.UI.ApplicationPages.CalendarNotify.$4a;
    SP.UI.ApplicationPages.CalendarNotify.$4a = function ()
    {
        old$4a();
        ctrl = SP.UI.ApplicationPages.CalendarInstanceRepository.firstInstance();
        if (ctrl) {
            ctrl.expandAll();
        }
    }
}</script>

********************************************************************

Reference :-- REFERENCE

Thursday, 18 August 2011

Importing & Exporting sites in SharePoint 2010 using Powershell

In SharePoint 2010 you can import and export sites, lists, document libraries and items using Export-SPWeb and Import-SPWeb.

Here’s how you export a site in SharePoint 2010:
Export-SPWeb http://SP/TeamSite –Path C:\Backup\website.bak

If you only want to export a list in a site you can use –ItemUrl parameter as shown below:
Export-SPWeb http://SP/TeamSite -ItemUrl “Lists/Announcements” –Path C:\Backup\website.bak

You can use the Import-SPWeb cmdlet to import the exported files to SharePoint 2010.
Import-SPWeb http://SP/TeamSite –Path C:\Backup\website.bak

You can also check the other multiple options available with these commands(like -force etc..) at the powershell by pressing tab key.

Popular Posts