Show calendar events in modal dialog in SharePoint 2013

Add the below code in the calendar view page using designer or add using script editor / content editor in the page where calendar view inserted

<script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        setInterval(function () {
            $("a[href*='DispForm.aspx']").each(function () {
                $(this).attr("onclick", "openDialog('" + $(this).text() + "','" + $(this).attr("href") + "')");
                $(this).attr("href", "javascript:void(0)");
                $(this).removeAttr("target");
            });
        }, 900);
    });

    function openDialog(title, url) {
        var options = {
            title: "Calendar - " + title,
            autoSize: true,
            url: url
        };
        SP.UI.ModalDialog.showModalDialog(options);
    }

</script>

Hope this will help you...

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell