表单窗口中的内容不可选。当尝试选择时,它还会拖动整个内部内容。如何避免它

时间:2012-03-09 11:29:02

标签: forms extjs

var settingForm = Ext.create('Ext.form.Panel', {
    frame: false,
    bodyStyle: 'padding:5px 5px 0',
    modal: true,
    resizable: false,
    draggable: true,
    forceSelection: true,
    fieldDefaults: {
        labelAlign: 'right',
        //msgTarget: 'side',
        labelWidth: 140
    },
    items: [{
        xtype: 'fieldset',
        anchor: '100%',
        title: 'Some Information',
        layout: 'column',
        items: [{
            xtype: 'container',
            columnWidth: .5,
            layout: 'anchor',
            items: [{
                xtype: 'hiddenfield',
                name: 'txtHiddenId',
                id: 'txtHiddenId'
            }, {
                xtype: 'textfield',
                fieldLabel: 'Host Name',
                name: 'txtHostName',
                id: 'txtHostNameId',
                allowBlank: false,
                anchor: '96%',
                disabled: true,
                enableKeyEvents: true,
                listeners: {
                    keypress: function() {
                        manageUpdate();
                    },
                    specialkey: function(field, e) {
                        if (e.getKey() == "46" || e.getKey() == "8")
                            manageUpdate();
                    }
                }
            }

1 个答案:

答案 0 :(得分:1)

删除draggable: trueforceSelection: true。看看它是否有帮助。