PDA

View Full Version : [CLOSED] 0.5.4 - ext:window not shown in Firefox



matteo
Oct 02, 2008, 6:17 AM
Hi Geoff,

is this maybe a bug or am I doing something wrong, please see the code below:




...

<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" Theme="Default" runat="server"></ext:ScriptManager>



<ext:Window ID="Window1" runat="server" Maximizable="true" Closable="false" Collapsible="true" Icon="Application" Title="Title">
<Content>
<p>hello</p>
</Content>
<Listeners>
<Maximize Handler="function (el){ var view = Ext.getBody().getViewSize(); el.setSize(view.width, view.height); }" />
</Listeners>
</ext:Window>


</form>



it works fine in IE but in Firefox I can only see the text 'Hello', then by removing Listeners all works fine also in FF.

Thanx

Bye

Matteo

matteo
Oct 02, 2008, 6:33 AM
Well

I was wrong (or the code I saw in some posts) sorry, I tried the fallawing and it works:



<Listeners>
<Maximize Handler="var view = Ext.getBody().getViewSize(); el.setSize(view.width, view.height); " />
</Listeners>


Thanx

Matteo

geoffrey.mcgill
Oct 02, 2008, 12:28 PM
Hi matteo,

Yes, with 0.5+ the value of the .Handler property does not need to be wrapped in a function(){} template. 


If you want to have complete control over the format/syntax of the function, you can set the .Fn property which will render exactly what you supply. The .Fn property is also very useful if you want to define the function in your own custom script and just provide a pointer to the function.


Example


// Set the function name
Fn="doSomething"

// then define the doSomething function elsewhere
var doSomthing (el) {
alert("doSomething here");
};

In your original example, if you change the .Handler property to .Fn, I think it should work. 


Hope this helps.

matteo
Oct 02, 2008, 2:16 PM
Thanks Geoff, all clear!