Maximize modal dialog window automatically

In my previous post I have shown how to open a page in modal dialog. In this post I am going to show a script which will be used to open a modal dialog in maximize mode. In this case we do not required to mention width and height in modal dialog options.

<script type="text/javascript">
    function maximizeWindow() {
        var currentDialog = SP.UI.ModalDialog.get_childDialog();
        if (currentDialog != null) {
            if (!currentDialog.$S_0) {
                currentDialog.$z();
            }
        }
    }

    ExecuteOrDelayUntilScriptLoaded(maximizeWindow, 'sp.ui.dialog.js');
</script>

Comments

Post a Comment

Popular posts from this blog

Switch from Classic to Claims Authentication in SharePoint 2010

How to query list data using web service