1

how can I change the title of a modal window open through the command using?

ExecuteOrDelayUntilScriptLoaded(function () { openModalWindow('.....')},\"sp.js\");  

I would like the person to see: loading ...

and at the end of the loading to then show the true title of the page.


This solution sets the title of the modal window, I would like to change the title after the window has been opened.

3 Answers 3

1

Hi you can find the same question here:

Pass parameters in ExecuteOrDelayuntilScriptLoaded in Javascript client Object model

To make changes to the title like so in JavaScript:

var win = window.open();

win.document.title="......Change Me......";
0

I don't know how you plan on loading your modal dialog, but usually you can just do as below:

var options = SP.UI.$create_DialogOptions();
options.url = "url to the page";
options.title = "Modal Dialog Title Here";

SP.UI.ModalDialog.showModalDialog(options);

Which then would make yours look something like this:

var options = SP.UI.$create_DialogOptions();
options.url = "url to the page";
options.title = "Modal Dialog Title Here";

ExecuteOrDelayUntilScriptLoaded(function () { SP.UI.ModalDialog.showModalDialog(options);},"sp.js");  
1
  • I would like to change the title of modaldialog once the page in dialog is fully charged. Commented Aug 21, 2012 at 7:05
-1

Simonw pass the title like so:

<a href="#" onclick="openDialog('Test.aspx?ID={@ID}','{$title}'); return true "/>

<script type="text/javascript">
function openDialog(FormPath,Title) {
    var options = {
        url: FormPath,
        width: 950,
        height: 800,
        title: Title,
        allowMaximize:'true'

    };
    SP.UI.ModalDialog.showModalDialog(options);
}
</script>

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.