EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: crosemffet on December 23, 2012, 05:29:04 AM



Title: window title problem
Post by: crosemffet on December 23, 2012, 05:29:04 AM
I'm trying to open a help window, and then set the title, according to the window contents ajax loaded.
the code is:
main page:
<div id="whelp" class="easyui-window" closed="true" data-options="modal:true" style="width:600px;height:600px;padding:10px;"></div>
<script>
$('#whelp').window({
    collapsible:false,
    minimizable:false,
    maximizable:false,
   resizable:false,
   draggable:false
})

function showHelp(data){
   $('#whelp').window('open');
   $('#whelp').window('refresh', 'myURL.php?id=' + data);
}
</script>

then, myURL.php code is:
<?php
echo $myHelpText;
?>
<script>
$('#whelp').window({title: "myNewTitle"});
</script>
the windows open, but then closed suddenly.
the problem was in the title line inside the script tag.
if I comment it, everything goes right.
what's wrong with the title line...?
thanks in advance,
regards,


Title: Re: window title problem
Post by: stworthy on December 23, 2012, 06:48:44 AM
To change the window title, please use 'setTitle' method instead.

$('#whelp').window('setTitle','myNewTitle');