Tag Info

Hot answers tagged

14

May not be the best wat but it works: var test = "<div id='correspondence'>" + result + "</div>"; $('body').append(test); SP.UI.ModalDialog.showModalDialog({ html: document.getElementById(''correspondence''), title: "Correspondence", allowMaximize: false, showClose: true, ...


11

You can use one of the following methods: SP.UI.ModalDialog.showWaitScreenSize or SP.UI.ModalDialog.showWaitScreenWithNoClose. Example: waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose("Loading...", "Please wait while data is retrieved...", 60, 280); --------wait for something-------- waitDialog.close(SP.UI.DialogResult.OK); Check out all ...


8

Try this: if (window.location.search.match("[?&]IsDlg=1"))


8

Juergen, The below article should help: http://blog.collabware.com/2013/03/22/tips-tricks-sharepoint-2013-modal-dialogs/ You have SP.UI.ModalDialog.showWaitScreenWithNoClose which can be used.. function RequestEnded(sender, args) { try { waitDialog.close(); waitDialog = null; } catch (ex) { } }; function RequestStarted(sender, args) { ...


7

Found a solution. Add this to the end of the button click event: Context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>"); Context.Response.Flush(); Context.Response.End();


7

There is this SP.UI.ModalDialog class (MSDN doku). With dialogOptions you can specify, how will your page behave after the user closes the dialog. function OpenMasterdataDialog(strPageURL) { var dialogOptions = SP.UI.$create_DialogOptions(); dialogOptions.url = yourPageWithDialogContent; dialogOptions.width = 750; dialogOptions.height = ...


7

http://www.chakkaradeep.com/post/Using-the-SharePoint-2010-Modal-Dialog.aspx is a good example. Basically you create the Modal dialog like so... //Dialog Opening function OpenDialog() { var options = SP.UI.$create_DialogOptions(); options.url = '/_layouts/mySolution/myPage.aspx'; options.width = 500; options.height = 400; ...


6

just add .ms-dialog in front of the class you want to change, and it will only affect the modal dialogs: .ms-dialog .ms-cui-topBar2{ background-color: red; }


6

The id of the close button is not just "DlgClose" it is "DlgClose< GUID >". For example, DlgClose355aef3c-ef2f-4293-a7b1-ffa236195624 In your jQuery code, you are using a begins-with selector ^ which gets all elements whose id starts with a particular string. (DlgClose in this case.) While in your JavaScript code, you are getting all the elements whose ...


6

The internal names of SP_UI_Dialog has changed in on RTM SP2013 on-premises so you should use: function _maximizeWindow() { var currentDialog = SP.UI.ModalDialog.get_childDialog(); if (currentDialog != null && !currentDialog.$Q_0) { currentDialog.$1Y_0(); } } ExecuteOrDelayUntilScriptLoaded(_maximizeWindow, 'sp.ui.dialog.js'); On the ...


5

you can open the modal dialog without a postback something like: <asp:Button runat="server ID="TestButton" onclick="javascript:...." The second point is that you dont need to put the whole path to the application page into the url. When you open the modal dialog from an application page AddCat.aspx would be enough. But how do I do this. First I build ...


5

I had the same task. I found that NewForm.aspx handles automatically query strings which surprised me. The query strings must use internal names. And there is no need for custom code. So to pre-fill Title in the NewForm.aspx (even if you see "Titel" or "Tittel" or something else), just add ?Title=Hurray, like ...


4

The only scenario which gives the option of an alternative UI is the case where the sites were upgraded from WSS 3.0/SharePoint 2007, and you make use of the Visual Upgrade capability. This allows you to preserve the earlier look and feel to allow you to transition more slowly e.g. to give time to make any required changes to custom master pages. However it ...


4

If you issue is that the master page is being applied to your dialog boxes, I was having a similar issue. I had images that were apart of the master page and they would 'push down' all the content, so the dialog box would be the size it should be based on the elements in it, but then because of the images, not everything could show on the screen. I fixed ...


4

I have added my comments to the above answers. Here are a couple additional - untested - suggestions: To build on Steve's suggestion, reload the url without IsDlg (simple, just not ideal from a performance viewpoint): window.location.href=window.location.href.replace(/[?&]IsDlg=1/,""); SharePoint uses the class s4-notdlg to identify what should be ...


4

So what you want to do is to change the size of the dialog when the upload.aspx is closed. Try this code ExecuteOrDelayUntilScriptLoaded(function () { var dlg = window.parent.SP.UI.ModalDialog.get_childDialog(); dlg.$Q_0(800, 800); //width, height }, "sp.ui.dialog.js"); Also, if you want to size the dialog automatically without specifying the height ...


4

I'm not sure if I understood you correctly. But when I want to open form I use asp:HyperLink and in codebehind I set NavigateUrl like this: hyperLink.NavigateUrl = "javascript:SP.UI.ModalDialog.ShowPopupDialog('" + url + "')"; If you want to open form (edit, view, etc) use copyutil - it can generate the exact url address for you: ...


4

In the first code snippet you have doubled the ' around getElementById. In the second code snippet you have forgotten the html: in front of getElementById Edit after James comment: If you are not using minimal download strategy, you do not have to use SOD.


4

Yes. You can place web part in any page and show this page in dialog. How to call dialog: MSDN: SP.UI.ModalDialog.showModalDialog(options) Method


4

check proper app permissions is given. <AppPermissionRequests> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" /> </AppPermissionRequests> as well if you are using SharePoint Hosted app, try the following example. http://code.msdn.microsoft.com/office/SharePoint-2013-Use-list-cb3e4e14 ...


3

I know this is an old answer, but I thought I'd chip in: Most people use the query string approach. The SPServices plug in is really useful here (http://spservices.codeplex.com/), or you can write your own javascript within the form to get querystring parameters. I normally bundle this in to my own method: function getQueryParameters() { var qObj = {}; ...


3

Actually, you can set it up so that you can use the Rich Text in IE9 (some people believe you have to disable it completely)! You just have to override 3 functions in form.js (I created a file called form.ie9fix.js) and make sure it loads AFTER the "normal" form.js (or form.debug.js, whichever). The functions in question: RTE_DD_GetMenuFrame() ...


3

Definitely sounds like a JavaScript error as @default noted. Wanted to point out that your callback will not work as you are anticipating. SP.UI.ModalDialog.RefreshPage accepts a value of 1 or 0 for it to refresh the page. Try out my simple mods to your code: function loadPlayVideoDialog() { var options = { url: '(...)PlayVideo.aspx', autoSize: ...


3

I solved the problem / Found the bug. I neglected to tell you that a SPLongOperation were running inside the modal dialog. I think that might have had an impact, especially since a part of the code were actually closing the dialog after the LongOperation were finished (DOH!). No wonder parameters weren't set. I still weren't able to write js to the resonse ...


3

When in Dialog mode the window.frameElement is NEVER null. use this as example on how to close it remotely var parentObject = window.frameElement; if (parentObject != null) { var waitDialog = parentObject.waitDialog; if (waitDialog != null) { waitDialog.close(); } }


3

Go to document library settings > Advanced Settings > Launch forms in a dialog (Check yes) and Save. It should work.


3

The previous answer (where some data are concatenated into string, returned to the parent page and then split into values) seems to be a bit complicated and even redundant. Because we always can return data to the parent page as var returnValue = []; // array returnValue[0] = 123; returnValue[1] = 'hello'; ...


3

You can create a Custom Action which will add a print button to your Newform.aspx and EditForm.aspx forms, and in the Command you can define a javascript to print current window. See sample below: Example for NewForm.aspx <CustomAction Description="Print me" Title="Show Me" Id="{E538E8C7-65DA-454E-AD87-4A603B6CC569}" ...


3

The following code is working. There were 2 errors which I have commented in the code. //use a button for example <input type="button" value="Launch Dialog" id="myDialog" onclick="openDiaForm();"/> //inside script tags under PlaceHolder Main function openDiaForm() { //Use SP.UI.$create_DialogOptions() instead of SP.UI.create_DialogOptions() ...


3

It can be accomplished with context.Response.Write("<script type='text/javascript'>window.frameElement.navigateParent('myParentPage.aspx');</script>");



Only top voted, non community-wiki answers of a minimum length are eligible