Tag Info

Hot answers tagged

7

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 ...


6

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, ...


6

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 = ...


5

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; ...


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

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 ...


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 ...


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

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

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

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 ...


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 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 ...


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

Make sure that sp.ui.dialog.js has completed loading before you call your opendialog function. Call the OpenInDialog() function like this: ExecuteOrDelayUntilScriptLoaded(function(){ OpenInDialog('test', 'http://portal.dev.loc/sites/TestSite/_layouts/Test.aspx'); },"sp.ui.dialog.js");


3

In Wiki pages SharePoint will always remove scripts, or calls to javascript. One way to overcome is to use jQuery :live functions in a function in a separate .js file stored somewhere in a Document library and added in page via a CEWP, but then add an ID to your Link item. Yes, it sounds like overkill, but that would be one way to do it.


2

It looks as if you have not properly defined your alternate access mappings. Your web application might listen on port 80 and port 700 but only one has been defined in the AAM settings. Internet Explorer uses integrated authentication and logs on to the other web application automatically. Firefox and Chrome are not able to log onto the different site if ...


2

You can pass it as a parameter to Open() function and then to OpenCustomDialogWithRefresh() function. You can pass it on as a query string parameter like: strPageURL = strPageURL + '?id=" + idParam You can access the query string parameter in View.aspx. You can also pass it as args property of your options. Check this article: ...


2

Obviously its a width issue. There is a width set in your master page either for the body, s4-ribbonrow or s4-workspace or s4-pr some other custom class. You need to avoid this width setting in your dialog boxes. Add .ms-dialog class and customize for avoiding this in dialog boxes. For eg:- If your css file has custom width on s4-pr, it should be, ...


2

@DJ Monzyk this is a follow up javascript file as reference in previous answer function RTE_DD_GetMenuFrame() { var ifmMenu=null; var elemMenu=RTE_DD_GetMenuElement(); if (null !=elemMenu) { if (document.frames.length > 0) { ifmMenu=document.frames[g_strRTETextEditorPullDownMenuID]; } else ...


2

@Kate Ponomareva sorry for the delayed reply (wasnt online), follor below steps to add html form webpart 1 : through SPD create your required forms for the respective list and make them as default or you could use the default form itself 2 : go to your sharepoint site, click on the list from View All Site content or Quick Launch 3 : in top ribbon click on ...


2

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}" ...


2

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'; ...


2

You could simply use jQuery to identify if the page is loaded in an iframe: http://www.24hourapps.com/2009/01/check-if-page-is-loaded-in-iframe-using.html var isInIFrame = (window.location != window.parent.location) ? true : false; SharePoint dialog boxes are simply iframes.


2

Yea, there is a dialogReturnValueCallback option when using the SP.UI.ModalDialog.showModalDialog. See http://msdn.microsoft.com/en-us/library/ff410058%28v=office.14%29.aspx In the callback function you can test to see whether the user clicked ok or cancel to close the dialog. var options = SP.UI.$create_DialogOptions(); options.url = url; ...


2

Yes this is possible using JavaScript/jQuery. You will have to include the script in either your display form (which is displayed in the modal dialog) or in the Master Page directly. What your script will do is it will attach your custom click event to the "Save" or "Close" button on the form. Using jQuery you can do something like this: ...


2

With a sandboxed solution you can add your custom JavaScript and jQuery globally. And your custom JavaScript can be uploaded into Style Library and referenced there. All you need access to is solution gallery to upload, install and activate sandboxed solutions. Then you can check location.pathname for Upload.aspx, select the checkbox with jQuery and alter ...


2

Here is my solution $(function(){ ExecuteOrDelayUntilScriptLoaded(OverrideModal,"SP.js"); }); function OverrideModal(){ SP.UI.ModalDialog.showModalDialog_old = SP.UI.ModalDialog.showModalDialog; SP.UI.ModalDialog.showModalDialog = function(options){ options.autoSize = true; ...


2

I believe you are actually referring to the standard NewForm.aspx which is however shown in a pop-up (code usually adds IsDlg=1 in the Query string to enable automtic removal of extra content in page). It should be enough to customize the actual form via SharePoint Designer and replace the button value with your own, which very easily you could locate in the ...



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