jQWidgets Forums
jQuery UI Widgets › Forums › Dialogs and Notifications › Window › Opening window 2nd time
Tagged: initialization, jqxwindow, open, window
This topic contains 5 replies, has 2 voices, and was last updated by mr_putersmit 11 years, 1 month ago.
-
AuthorOpening window 2nd time Posts
-
Hi
I have a very simple window and am calling the function from an onpress event in flexigrid. The window opens the first time, but on subsequent clicks, nothing happens. Is there some code I am missing to open the window on further clicks. Thanksflexigrid code
{name: 'Help', bclass: 'help', onpress : helpWindow},
window code
function helpWindow() { $("#jqxwindow").jqxWindow({ height:'auto', width: 'auto', theme: 'darkblue', showCollapseButton: true, isModal: true }); }
Hello mr_putersmit,
The code in helpWindow initializes the grid and opens it. A second call to that function just re-sets the properties to the same values but does not open the window. We recommend that you execute the window initialization code just once in another part of your script and that you call only the window’s open method in helpWindow, i.e.:
function helpWindow() { $('#jqxwindow').jqxWindow('open'); }
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Dimitar
Thanks for reply. I am not quite sure I follow your answer. The amended code I have posted. is that correct? I didn’t think you could have 2 functions with the same name. Thanks
function helpWindow() { $("#jqxwindow").jqxWindow({ height:'auto', width: 'auto', theme: 'darkblue', showCollapseButton: true, isModal: true }); } function helpWindow() { $('#jqxwindow').jqxWindow('open'); }
Hi mr_putersmit,
As I said in my previous post, we recommend that you execute the window initialization code just once in another part of your script. This does not mean the helpWindow function. You can even do it on $(document).ready(), but you would have to set the autoOpen property to false then.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Dimitar
I have taken your suggestion but if i set the autoOpen: false the window does not fire at all. In my external js files I have the code:
function helpWindow() { $("#content").show(); $("#jqxwindow").jqxWindow({ height:'auto', width: 'auto', theme: 'summer', showCollapseButton: true, isModal: true, animationType: 'fade', autoOpen: false }); }
and in my index.php page I have:
<script type="text/javascript"> $(function(){ $('#jqxwindow').jqxWindow('open'); }); </script>
where am I going wrong with this. Thanks
Dimitar
Thanks very much, but have now got it sorted. Many thanks for your help
-
AuthorPosts
You must be logged in to reply to this topic.