-
27 Sep 2010 2:10 PM #1
trying to catch resize event on a panel
trying to catch resize event on a panel
I'm just trying to get a simple resize event handler working, but I've had no luck. Here's my code:
But I never see any messages logged. I do if I just throw a "console.log('here')" somewhere in onReady. So it's not my debugger. Am I doing something wrong? The api was a bit sparse on examples for listeners, so I had to cobble this together from random examples.Code:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title id="title">test</title> <link rel="stylesheet" href="../resources/css/ext-touch.css" type="text/css"> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> <script type="text/javascript" src="../ext-touch-debug.js"></script> <script type="text/javascript"> Ext.setup({ onReady: function() { var map = new Ext.Map({ listeners:{ resize:function() { console.log('resize'); } } }); var mainPanel = new Ext.Panel({ fullscreen: true, items:[map] }); } }); </script> </head> <body></body> </html>
-
27 Sep 2010 3:21 PM #2
The main panel has no layout, so it's never going to size the child items. You want the fit layout.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
27 Sep 2010 8:55 PM #3
Thanks for the reply! Do you mean like this?
I still don't get any resize log messages when I do it this way.Code:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title id="title">test</title> <link rel="stylesheet" href="../resources/css/ext-touch.css" type="text/css"> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> <script type="text/javascript" src="../ext-touch-debug.js"></script> <script type="text/javascript"> Ext.setup({ onReady: function() { var map = new Ext.Map({ listeners:{ resize:function() { console.log('resize'); } } }); var mainPanel = new Ext.Panel({ fullscreen: true, layout:'fit', items:[map], listeners:{ resize:function() { console.log('resize'); } } }); } }); </script> </head> <body></body> </html>
-
8 May 2012 12:48 PM #4
Bump. No response, evant? I still don't see panel resize events when I think I should (1.1). Others have reported this as well.
Similar Threads
-
Panel Resize Event Question
By parky128 in forum Ext 3.x: Help & DiscussionReplies: 9Last Post: 1 Apr 2010, 2:54 AM -
How to catch Browser Resize event
By prakash.raman in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 8 May 2009, 6:06 AM -
How to get resize event for Ext.Panel?
By mickh in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 12 Nov 2008, 2:12 AM -
[Panel resize event] Is not raised?
By dplus in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 16 Mar 2008, 12:14 PM -
how can I catch enddrag event on a panel
By nomi_5 in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 8 Jan 2007, 2:07 AM


Reply With Quote