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.

Anders Rask
  • 17,949
  • 3
  • 38
  • 71
Simone Polinari
  • 111
  • 1
  • 3

3 Answers3

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......";
Ganesh Sanap - MVP
  • 44,918
  • 21
  • 30
  • 61
Ali Jafer
  • 17,808
  • 1
  • 27
  • 41
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

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

naijacoder
  • 4,272
  • 26
  • 101
  • 188