Results 1 to 7 of 7

Thread: binding body onresize event

  1. #1
    Sencha User emredagli's Avatar
    Join Date
    Jun 2008
    Posts
    301
    Vote Rating
    2
      0  

    Default binding body onresize event

    Hi,
    I want to bind body's onresize event.
    I try this:
    Code:
    var el = Ext.getBody();
    el.on('onresize', function(){alert('resize');});
    I also try addListener method.But it doesn't work.

    Thanks for your advance.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,618
    Vote Rating
    52
      0  

    Default

    Use a Viewport.

  3. #3
    Sencha User emredagli's Avatar
    Join Date
    Jun 2008
    Posts
    301
    Vote Rating
    2
      0  

    Default

    You are right Mr. Animal,
    I just trying this.
    Viewport's resize event works fine when I try to resize browser.

    Thanks for your comment.

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,618
    Vote Rating
    52
      0  

    Default

    You shouldn't need to listen for the event if you use layouts correctly. Ext handles all this for you if you tell it to.

  5. #5
    Sencha User emredagli's Avatar
    Join Date
    Jun 2008
    Posts
    301
    Vote Rating
    2
      0  

    Default

    Acually, Mr. Animal,
    I have problem on merging form layout and anchor layout:
    I have a htmleditor component and I want to set its height as anchor.
    Code:
    items:[{
        style:'padding-top:5px;padding-left:5px;',
        frame: false,
        labelWidth: 100,
        layout:'form',
        defaultType: 'textfield',
        items:[
        {
            id: 'subject', 
            fieldLabel: 'Subject',
            width: '50%'
        },{
            xtype: 'htmleditor',
            id: 'messageBody',
            fieldLabel:'Message Body',
            width: '95%',
            height: (Ext.isIE ? document.body.offsetHeight : window.innerHeight) - 250
        }]
    }]
    I try to give height: '80%' ... But it doesn't work fine.
    finally I decide to write a funciton which is listen resize event and I resize this component myself...

    I am sure there must be a easy way...

    Thanks.

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,618
    Vote Rating
    52
      0  

    Default

    height and width are numeric settings.

    I think you want the anchor config.

    http://extjs.com/deploy/dev/docs/?cl...t.AnchorLayout

  7. #7
    Sencha User
    Join Date
    Oct 2016
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by emredagli View Post
    You are right Mr. Animal,
    I just trying this.
    Viewport's resize event works fine when I try to resize browser.

    Thanks for your comment.
    Hi, i am trying to use Viewport's resize event but it's not working for me. can you post the sample which you tried.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •