1. #1
    Touch Premium Member pkellner's Avatar
    Join Date
    Sep 2008
    Location
    San Jose, California
    Posts
    802
    Vote Rating
    23
    pkellner will become famous soon enough pkellner will become famous soon enough

      0  

    Default how to get resize with events to work on div

    how to get resize with events to work on div


    I've got a div that changes size as the browser size changes. That is, it's something like 80% width and 50% height of browser. When the user resized the browser, I'd like an event to be called that I can act on, but I want to have it wait a certain number of milliseconds before calling.

    Is there a ExtJS function that will help me with that?

    Thanks,

    Peter Kellner
    http://peterkellner.net

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,170
    Vote Rating
    674
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    How is the div changing size? Are you triggering a script, or does it happen when the window resizes?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext User santosh.rajan's Avatar
    Join Date
    Sep 2007
    Location
    Kannur, Kerala, India
    Posts
    611
    Vote Rating
    0
    santosh.rajan is on a distinguished road

      0  
    Make everything as simple as possible, but not simpler.
    - Albert Einstein

  4. #4
    Touch Premium Member pkellner's Avatar
    Join Date
    Sep 2008
    Location
    San Jose, California
    Posts
    802
    Vote Rating
    23
    pkellner will become famous soon enough pkellner will become famous soon enough

      0  

    Default OK, here is some code

    OK, here is some code


    I'm wanting to understand how I can have 3 div's on my page and have the javascript (extjs lib) automatically manage their sizes (Viewport I think). I can't figure out how to get ViewPort to reference my div's.

    Sorry if I'm not asking clearly. not that good at javascript, new to extjs.



    <formname="aspnetForm"method="post"action="Available"id="aspnetForm">
    <scriptsrc="../../ExtJS/adapter/ext/ext-base.js"type="text/javascript"></script>
    <scriptsrc="../../ExtJS/ext-all.js"type="text/javascript"></script>
    <divid='TopOfPage'style="margin: 100100100100; background-color: Lime;">
    top of page
    </div>
    <divid='MiddleOfPage'style="margin: 100100100100; background-color: Lime;">
    middle of page
    </div>
    <divid='BottomOfPage'style="margin: 100100100100; background-color: Lime;">
    bottom of page
    </div>
    <scripttype="text/javascript">
    Ext.onReady(function() {
    new Ext.Viewport({
    layout:
    'border',
    items: [{
    region:
    'center',
    xtype:
    'tabpanel',
    items: {
    title:
    'Default Tab',
    html:
    'The first tab\'s content. Others may be added dynamically'
    }
    }]
    });
    });

    </script>
    </form>


  5. #5
    Ext User santosh.rajan's Avatar
    Join Date
    Sep 2007
    Location
    Kannur, Kerala, India
    Posts
    611
    Vote Rating
    0
    santosh.rajan is on a distinguished road

      0  

    Default


    It is not clear what you are trying to do exactly. But if you are using a viewport, you do not need to use those divs.
    Make everything as simple as possible, but not simpler.
    - Albert Einstein

Thread Participants: 2