1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Pune
    Posts
    71
    Vote Rating
    0
    kislay.kishore is on a distinguished road

      0  

    Default top, left, bottom and right co-ordinates of a Panel

    top, left, bottom and right co-ordinates of a Panel


    How can I get top, left, bottom and right co-ordinates of a Panel using extjs4.0, given the id of my panel is "myPanel"?

    I tried myPanel.frameSize.top, but it comes as zero. Looks like, I am hitting something wrong here.

    Please advise.

    Thanks!

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,982
    Vote Rating
    453
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Try this and have a look around

    Code:
    Ext.create('Ext.panel.Panel', {
        id: 'mypanel',
        title: 'Hello',
        width: 200,
        height: 100,
        html: '<p>World!</p>',
        renderTo: Ext.getBody()
    });
    
    var pnl = Ext.getCmp('mypanel');
    console.log(pnl);
    console.log(pnl.getPosition());
    console.log(pnl.componentLayout.info.bodyBox);
    Regards,
    Scott.

Thread Participants: 1