Results 1 to 6 of 6

Thread: Set margins for Ext.layout.BorderLayout.Region

  1. #1
    Sencha User
    Join Date
    Mar 2009
    Posts
    23

    Question Set margins for Ext.layout.BorderLayout.Region

    Hi

    i have a problem.

    Code:
      Demo = Ext.extend(Ext.Panel, {
        border: true,
        region: 'center',
        margins:  '5 5 5 5',
        initComponent: function() {
          Demo.superclass.initComponent.call(this);
        }
      });
    The margins value will be ignored. How i should set the margins for the Ext.layout.BorderLayout.Region.

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Why are you extending?

    Why aren't you just configuring a Panel with margins?

  3. #3
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    I agree with Animal, but if you actually do have a good reason to create a new class then your problem is that you are not setting the initialConfig, e.g.
    Code:
    Demo = Ext.extend(Ext.Panel, {
      initComponent: function() {
        var cfg = {
          border: true,
          region: 'center',
          margins:  '5 5 5 5'
        };
        Ext.apply(this, cfg);
        Ext.apply(this.initialConfig, cfg);
        Demo.superclass.initComponent.call(this);
      }
    });

  4. #4
    Sencha User
    Join Date
    Mar 2009
    Posts
    23

    Default

    becsaue i need a base panel that i will use for most other panels.

    @condor

    thaks that works

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    How many center regions are you planning to have?

  6. #6
    Sencha User
    Join Date
    Mar 2009
    Posts
    23

    Default

    every page i have, based on an App.BasePanel that have some default values (e.g. margins) and some events for loading mask.

Similar Threads

  1. [Ext 2.0] Region width always assumes 5px left/right margins?
    By jarrod in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 28 Aug 2007, 7:33 AM
  2. Collapsed layout region don't respect 'margins' config property.
    By MaximGB in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 31 Jul 2007, 4:54 PM
  3. Replies: 0
    Last Post: 31 Jul 2007, 4:54 PM

Posting Permissions

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