Extjs Ext.form.field.标记,未激发resize事件

9wbgstp7  于 2022-11-23  发布在  其他
关注(0)|答案(1)|浏览(119)

在调整创建tagfield的面板的大小后,tagfield的resize事件不会被触发。

Ext.application({
    name: 'Fiddle',

    launch: function () {
        var shows = Ext.create('Ext.data.Store', {
            fields: ['id', 'show'],
            data: [{
                id: 0,
                show: 'Battlestar Galactica'
            }, {
                id: 1,
                show: 'Doctor Who'
            }, {
                id: 2,
                show: 'Farscape'
            }, {
                id: 3,
                show: 'Firefly'
            }, {
                id: 4,
                show: 'Star Trek'
            }, {
                id: 5,
                show: 'Star Wars: Christmas Special'
            }]
        });
        var panel = new Ext.panel.Panel({
            layout: {
                type: 'vbox',
                align: 'stretch'
            },
            items: [{
                xtype: 'textfield',
                fieldLabel: 'One Two Three Four Five Six Seven',
                labelAlign: 'top',
                width: '100%'
            }, {
                xtype: 'tagfield',
                fieldLabel: 'One Two Three Four Five Six Seven',
                labelAlign: 'top',
                store: shows,
                displayField: 'show',
                valueField: 'id',
                queryMode: 'local',
                filterPickList: true,
                width: '100%',
                listeners: {
                    resize: function () {
                        debugger, //the event is not fired 

                    }
                }
            }]
        })

        var window = new Ext.Window({
            layout: 'anchor',
            title: 'Hello resizer',
            resizable: {
                dynamic: true
            },

            draggable: true,
            scrollable: 'vertical',
            items: [panel],
            width: 400,
            height: 200,
        });

        window.show();
    }
});
o4hqfura

o4hqfura1#

正如API文档中所述:* 此事件不会在使用cfg-liquidLayout的组件上激发,例如Ext.button.Button和Ext. form. field. Base。*

相关问题