Thursday, January 17, 2013

Calendar Option Click the particular cell

<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>

No comments:

Post a Comment