1. #1
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,120
    Vote Rating
    30
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default Resizers on FormFields don't show up

    Resizers on FormFields don't show up


    In the Beta[2]

    Code:
    Ext.onReady(function() {
    
        var simple = Ext.create('Ext.form.Panel', {
            url: 'save-form.php',
            frame: true,
            title: 'Simple Form',
            bodyStyle: 'padding:5px 5px 0',
            width: 350,
            
            defaultType: 'textfield',
            layout: 'auto',
    
            items: [{
                fieldLabel: 'First Name',
                name: 'first',
                resizable: true,
                allowBlank: false
    }]
            });
    
            simple.render(document.body);
        });
    Setting the resizer on a formfield doesn't give an error anymore but the resizers don't show up when putting them on a formfield. How can I get them visible?

  2. #2
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    65
    Vote Rating
    1
    kevhender is on a distinguished road

      0  

  3. #3
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,120
    Vote Rating
    30
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default


    Can we get an answer on this one, or should I open a ticket for this?

  4. #4
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,120
    Vote Rating
    30
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default Work around

    Work around


    I got the resizers back with this workaround.

    Code:
    Ext.define('My.layout.FormResize', {
    
        /* Begin Definitions */
        alias: ['layout.formresize', 'layout.autocontainer'],
    
        extend: 'Ext.layout.container.Auto',
        /* End Definitions */
    
        type: 'formresize',
    
        isValidParent: function(item, target, position) {
            var itemDom = item.el ? item.el.dom : Ext.getDom(item),
                targetDom = (target && target.dom) || target;
    
            if (itemDom && targetDom) {
                if (typeof position == 'number') {
    
                    var itemId = itemDom.id;
                    var itemIdWrapped = itemId + '-rzwrap';
                    var targetId = targetDom.childNodes[position].id;
    
                    return (itemId == targetId) || (itemIdWrapped == targetId);
    
                }
                return itemDom.parentNode == targetDom;
            }
    
            return false;
        }
    });
    
    Ext.onReady(function() {
    
        var formPanel = Ext.create('Ext.form.Panel', {
            frame: true,
            title: 'Form Fields',
            width: 340,
            renderTo: Ext.getBody(),
            bodyPadding: 5,
    
            //layout: {type: 'table', columns: 1},
            layout: 'formresize',
    
            fieldDefaults: {
               
                width: 150
            },
    
            items: [{
                xtype: 'textfield',
                name: 'textfield1',
    
                listeners: {
    
                render:
                {
                    fn: function(component, eOpts) {
    
                        var resizer = Ext.create('Ext.resizer.Resizer', {                        
                            target: this.el
                        });
                    }
                }
                },
    
                fieldLabel: 'Text field',
                value: 'Text field value'
            }]
            });
        });
    The problem lies in isValidParent. That function returns false if the formfield is wrapped in cause of a set resizer. In that case the resizer was moved in the dom. The move shouldn't be a big problem if the setBox() in the contructor of the resizer was returning the correct measures during rendertime, but each updateLayout of the container was messing the sizes up again.

    Hopefully this bug is fixed in the next release.

Thread Participants: 1