Results 1 to 3 of 3

Thread: margin vs margins

    You found a bug! We've classified it as EXTJS-5291 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,934
    Vote Rating
    548
      0  

    Default margin vs margins

    I see this throughout the library... This might be just a documentation issue, but the source code refers to margins and margin as well.

    Well... which one should I use?

    Code:
    /**
     * @docauthor Jason Johnston <jason@sencha.com>
     ....
     *     @example
     *     Ext.create('Ext.form.Panel', {
     *         title: 'Field with Label',
     *         width: 400,
     *         bodyPadding: 10,
     *         renderTo: Ext.getBody(),
     *         layout: {
     *             type: 'hbox',
     *             align: 'middle'
     *         },
     *         items: [{
     *             xtype: 'textfield',
     *             hideLabel: true,
     *             flex: 1
     *         }, {
     *             xtype: 'label',
     *             forId: 'myFieldId',
     *             text: 'My Awesome Field',
     *             margins: '0 0 0 10'
     *         }]
     *     });
     */
    Ext.define('Ext.form.Label', {
        ...
    Code:
    Ext.define('Ext.Component', {
        ...
    
        /**
         * Displays component at specific xy position.
         * A floating component (like a menu) is positioned relative to its ownerCt if any.
         * Useful for popping up a context menu:
         *
         *     listeners: {
         *         itemcontextmenu: function(view, record, item, index, event, options) {
         *             Ext.create('Ext.menu.Menu', {
         *                 width: 100,
         *                 height: 100,
         *                 margin: '0 0 10 0',
         *                 items: [{
         *                     text: 'regular item 1'
         *                 },{
         *                     text: 'regular item 2'
         *                 },{
         *                     text: 'regular item 3'
         *                 }]
         *             }).showAt(event.getXY());
         *         }
         *     }
    ....

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Ext.AbstractComponent described the margin config so margins is incorrect and we should clean it up.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,934
    Vote Rating
    548
      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    Ext.AbstractComponent described the margin config so margins is incorrect and we should clean it up.
    Many doc examples still use the margins config instead of margin, here's one example:

    http://docs.sencha.com/extjs/4.2.0/#...ainer.Viewport

Posting Permissions

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