How to leverage SharePoint 2010 dialogs?
SharePoint 2010 has a robust modal dialog system that can be easily leveraged to build highly interactive solutions. Imaging being able to pop-up item edit forms or displaying notifications all without redirecting the user back and forth!
Here is the client side JavaScript that will allow you to open any page within a dialog box-
//Handle the DialogCallback callback function DialogCallback(dialogResult, returnValue){ window.location = window.location; } //Open the Dialog function OpenEditDialog(link){ var options = { url:link + '&IsDlg=1', width: 700, height: 700, dialogReturnValueCallback: DialogCallback}; SP.UI.ModalDialog.showModalDialog(options); }
To invoke the dialog, simply call the OpenEditDialog function with the target URL.
Notice that the IsDlg=1 query string parameter is appended within the OpenEditDialog function. The presence of “IsDlg” dynamically loads the "/_layouts/styles/dlgframe.css” file which applies “display:none” to all items using the “s4-notdlg” css class. This effectively hides items of this class in a dialog box. For example, v4.master uses the “s4-notdlg” class for the Ribbon control to hide the ribbon within dialogs.
UPDATE (09/13/2010): There are times when a quick non-modal notification or a semi-permanent status message is more appropriate. Check out this post on how to leverage these new UI frameworks: http://www.pranavsharma.com/blog/2010/09/13/sharepoint-2010-notifications-statuses/
One Response to How to leverage SharePoint 2010 dialogs?
Leave a Reply Cancel reply
Pages
What I'm Doing...
- What if Apple Designed SharePoint?: http://t.co/HmHXDXUV 3 days ago
- More updates...
Archives
- December 2011
- August 2011
- June 2011
- April 2011
- March 2011
- September 2010
- August 2010
- July 2010
- May 2010
- February 2010
- January 2010
- November 2009
- March 2009
- January 2009
- April 2008
- March 2008
- October 2007
- September 2007
- August 2007
- July 2007
- May 2007
- March 2007
- February 2007
- December 2006
- October 2006
- September 2006
- August 2006
- June 2006
- May 2006
- April 2006
- March 2006
- December 2005
- September 2005
- August 2005
- June 2005
- April 2005
- March 2005
- February 2005
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- March 2004
- September 2003
- August 2003
- April 2003
Categories
- Chromium OS
- Internet Explorer 7
- Kwizcom
- Miscellaneous
- Movies
- MS Office
- Music
- Night on the Town
- Office 2007
- Outlook 2007
- Pictures
- Products/Shopping
- Recovered Entries (01/19/2005)
- Restaurants/Food
- Sharepoint 2007 ( MOSS / WSS )
- Sharepoint 2010 (SPS / Foundation)
- Tech
- The Law
- TV
- Uncategorized
- Video Games
- Vista
- Visual Studio 2010
- VMWARE
- VMWARE Server 2.0
- Website
- Windows Live
- Work
- XP





Thanks mate! Just needed this