PDA

View Full Version : add maximize handler code via codebehind



sashe
May 27, 2008, 4:39 AM
Hi,

Would like to know how i can add the following code via codebehind



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


Below is how i plan to add the code (handler code here)



Dim newWin As New Coolite.Web.UI.Window
With newWin
.ID = "Win1"
.Title = "google.com"
.Width = Unit.Pixel(100)
.Height = Unit.Pixel(100)
.AutoLoad = http://google.com
.Minimizable = True
.Maximizable = True
.Collapsible = True
.ClientEvents = (handler code here)
.Show()
End With


Thanks in advance.

geoffrey.mcgill
May 27, 2008, 5:14 AM
Hi sashe,

I'm mixing C# and VB here, but basically, you just need to create a ClientEvent object first.


ClientEvent maximize = new ClientEvent();
maximize.Handler = [hander code here];

Dim newWin As New Coolite.Web.UI.Window
With newWin
.ID = "Win1"
.Title = "google.com"
.Width = Unit.Pixel(100)
.Height = Unit.Pixel(100)
.AutoLoad = http://google.com
.Minimizable = True
.Maximizable = True
.Collapsible = True
.ClientEvents.Maximize = maximize
.Show()
End With

I think the following should work as well...


.ClientEvents.Maximize = new ClientEvent([hander code here])

Hope this helps.

sashe
May 27, 2008, 10:30 AM
Thanks alot geoffrey... that worked like a charm.

Need another help tough was looking in the forums on how to minimize the window to a container but without any luck...

any help on this would be greatly appreciated.

Cheers,
Sashekumar