Posts

Showing posts from May, 2012

How to open hyperlinks into modal dialog box in SharePoint 2010

SharePoint 2010 provides new feature "Modal dialog box". In this blog we shows how to open hyperlinks in modal dialog box using simple jquery selector. Declaration syntax for modal dialog box is as follows //Using the DialogOptions class. var options = SP.UI.$create_DialogOptions(); options.title = "Dialog box title"; options.width = 300; options.height = 500; options.url = "PageUrl"; SP.UI.ModalDialog.showModalDialog(options); //Using a generic object. var options = {     title: "Dialog box title",     width: 300,     height: 500,     url: "PageUrl" }; SP.UI.ModalDialog.showModalDialog(options); Now we put above modal dialog syntax in jquery selector $("[href(selection attributes)' Condition ']").click ( function () {                                                           ...