Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers

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

share|improve this answer
add comment

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");  
share|improve this answer
    
I would like to change the title of modaldialog once the page in dialog is fully charged. –  Simone Polinari Aug 21 '12 at 7:05
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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