当其他地方点击屏幕时,Extjs 2.3 Combobox Multi Selection清除

时间:2014-02-20 16:51:44

标签: javascript extjs2

插件有一个奇怪的问题,允许组合框允许多个选择,插件是LovCombo,我让它工作到我可以选择多个选择的点,如果我用向下箭头折叠组合框我看到选择保留在组合框中,如果我进行选择,然后点击组合框外的任何地方,那么值就会消失!

问题可以在http://jsfiddle.net/5Asf4/12/

看到
Ext.onReady(function () {

var lc = new Ext.ux.form.LovCombo({
     id:'lovcombo'
    //,width:300
    ,fieldLabel: 'Test Data'
    ,hideOnSelect:false
    //,maxHeight:200
    ,store:[
         [1, 'Personnel []']
        ,[11, 'Finance (33)']
        ,[5, 'Door']
        ,[6, 'Door Panel']
        ,[2, 'Management !77']
        ,[25, 'Production']
        ,[3, 'Users']
        ,[20, 'Window']
        ,[21, 'Window Panel']
        ,[22, 'Form Panel']
        ,[23, 'Grid Panel']
        ,[24, 'Data View Panel']
    ]
    ,triggerAction:'all'
    ,mode:'local'
});

var addAssetDialog = new Ext.Window( {
    id: 'maintenance_addAssetDialog',
    title: 'Test Multi Select Combobox',
    closeAction: 'hide',
    items:[
        {
            xtype: 'form',
            id: 'maintenance_addAssetForm',
            border: false, 
            bodyBorder: false,
            items: [
                lc
            ],
        }
    ],
    buttons:[
        {                           
            text: 'Cancel',
            disabled: true,
            handler: function ( ) {
            }, 
            scope: this
        },
        {
            text: 'Save',
            disabled: true, 
            handler: function ( ) {
            }, 
            scope: this 
        }
    ],
});

addAssetDialog.show();

}); //结束onReady

1 个答案:

答案 0 :(得分:0)

从sencha论坛找到了解决方案,由savva发表评论http://www.extjs.com/forum/showthread.php?p=427065#post427065

将以下行添加到配置

beforeBlur: Ext.emptyFn

jsfilddle已更新以显示修复程序 http://jsfiddle.net/shauncraig007/5Asf4/13/