Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In SharePoint 2010, when you try to add new item to list, edit item or view item dialog box gets opened. And once you have done with the action you remain on the same page, so minimal to and fro navigation.But in SharePoint 2013, you get navigated to another page and once completing action you get back to page or you need to navigate back yourself.
But what if you have migrated your application from 2010 to 2013 and now end user wants the dialog box instead of navigating to another page? No need to worry, SharePoint has provided you option to choose either dialog box or 2013 behavior.
Steps to force to open the dialog box for list forms: ** **
1. Go to the List/ library Settings
2. Now go to the advanced settings, scroll down and go to the ‘Dialogs’ Section. Select “Yes”
3. Click Ok and you done. Now you can see list forms get opened in dialog box as shown in below screen shot.
About Calendar List
Now one thing about the calendar list I have noticed: Once you enable the Dialog box for calendar list all forms (new, edit and view) gets opened in dialog box; for opening the view form in dialog box you need to click on the box of meeting and then View button from ribbon box. But what users do here is they click directly on the hyper link which shows the title of meeting and they get navigated to another page. We cannot say it as bug because we have to click on box rather than title but it is human tendency: click on hyper link wherever it appears. J
Now what you will do to avoid navigation to another page even clicked on hyper link or title? Use below JavaScript code snippet. Note: this is working only for Month View; you need to customize it for other views.
<script src="/jquery-1.9.1.js"></script>
<script type="text/javascript">
function openDialogBox(Url)
{
var ModalDialogOptions = { url:Url, width: 600, height: 500, showClose: true, allowMaximize: true};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', ModalDialogOptions);
}
$('.ms-acal-month').ready(function () {
setTimeout(function() {
$('a[href*="DispForm.aspx"]').each(function() {
$(this).attr('onclick', 'openDialogBox("' + $(this).attr('href') + '")');
//$(this).attr('onclick', ' ');
//alert($(this).attr('href'));
});
$('a[href*="DispForm.aspx"]').each(function() {
$(this).attr('href','javascript:openDialogBox("' + $(this).attr('href') + '")');
});
}, 3000);
});
</script>
What this code snippet does here is, it finds all meeting titles which are hyperlinks on the Month view and changes href attribute to call ‘openDialogBox’ JavaScript method. And ‘openDialogBox’ opens the page in dialog box.