1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    11
    Vote Rating
    0
    b.rameesh is on a distinguished road

      0  

    Default Please help! Extjs 4.x panel resize not working while window resizes

    Please help! Extjs 4.x panel resize not working while window resizes


    I want to resize the panel according to window screen resizing. How can I get this done? This works perfect in 2.x but not working in 4.x. Please help me to get this fixed.

    I have tried this two methods,

    Method:1
    Ext.create('Ext.panel.Panel', { title: 'Hello', autoWidth: true,

    autoheight: true, html: '<p>World!</p>', renderTo: Ext.getBody() });

    Method:2

    Ext.onReady(function() {
    var configs = [
    {
    title: 'Hello',
    autoWidth: true,
    autoheight: true,
    html: '<p>World!</p>',
    renderTo: Ext.getBody()
    }
    ];
    Ext.each(configs, function(config) {
    var element = Ext.getBody().createChild({cls: 'panel-container'});
    Ext.createWidget('panel', Ext.applyIf(config, {
    }));
    });

    });



    Attached Images

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,332
    Vote Rating
    83
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi!

    For your main container, i suggest hbox and/or vbox layouts with various flex settings.

    or you can use use onWindowResize event manager-

    Code:
    Ext.EventManager.onWindowResize(function () {
        var width=Ext.getBody().getViewSize().width-100
         ,height = Ext.getBody().getViewSize().height - 140;
        panel.setSize(width, height);
    });
    see the docs for more specifications:- http://docs.sencha.com/ext-js/4-1/#!...onWindowResize
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    11
    Vote Rating
    0
    b.rameesh is on a distinguished road

      0  

    Default


    Still it is not working.

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    18
    Vote Rating
    4
    aionescu is on a distinguished road

      0  

    Default


    Quote Originally Posted by b.rameesh View Post
    I want to resize the panel according to window screen resizing. How can I get this done? This works perfect in 2.x but not working in 4.x. Please help me to get this fixed.

    I have tried this two methods,

    Method:1
    Ext.create('Ext.panel.Panel', { title: 'Hello', autoWidth: true,

    autoheight: true, html: '<p>World!</p>', renderTo: Ext.getBody() });

    Method:2

    Ext.onReady(function() {
    var configs = [
    {
    title: 'Hello',
    autoWidth: true,
    autoheight: true,
    html: '<p>World!</p>',
    renderTo: Ext.getBody()
    }
    ];
    Ext.each(configs, function(config) {
    var element = Ext.getBody().createChild({cls: 'panel-container'});
    Ext.createWidget('panel', Ext.applyIf(config, {
    }));
    });

    });



    We had similar problems, and fixed them by using Viewports and Fit Layouts everywhere for the containers, so that Ext can always calculate and resize things.

  5. #5
    Sencha User
    Join Date
    Jun 2012
    Posts
    11
    Vote Rating
    0
    b.rameesh is on a distinguished road

      0  

    Default


    Thanks a lot for your reply

  6. #6
    Sencha User
    Join Date
    Jun 2012
    Posts
    11
    Vote Rating
    0
    b.rameesh is on a distinguished road

      0  

    Default FIxed

    FIxed


    Fixed by using view port,


    Ext.onReady(function(){

    var childPanel1 = Ext.create('Ext.panel.Panel', {
    title: 'Child Panel 1',
    renderTo: "customer",
    collapsible:true,
    contentEl: "customerInfo"
    });

    var childPanel2 = Ext.create('Ext.panel.Panel', {
    title: 'Child Panel 2',
    renderTo: "listing",
    collapsible:true,
    contentEl: "listingSearch"
    });


    Ext.create('Ext.container.Viewport', {
    items: [ childPanel1, childPanel2 ]
    });

    });

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar