【问题标题】:EXTJS comboBox multiselectEXTJS 组合框多选
【发布时间】:2012-06-29 02:01:06
【问题描述】:

在 ExtJS 3.3.1 中,我尝试将 comboBox 设置为 multi select ,但它不起作用。

请帮忙。

 var mArray = new Array("ALL", "AAA", "BBB");
        var mCombo = new Ext.form.ComboBox({ id: 'ID', fieldLabel: 'ID',
            triggerAction: 'all',
            height: 100, width: 163,
            multiSelect: true,
            store: mArray
        });
        Ext.getCmp('mCombo').setValue("ALL");

【问题讨论】:

    标签: javascript extjs extjs3


    【解决方案1】:

    Ext.form.ComboBox 中没有像 multiSelect 这样的配置选项。
    要获得所需的功能,您要么需要自己开发多选组合框,要么使用现有的替代方案之一,例如 Ext.ux.form.CheckboxComboExt.ux.form.SuperBoxSelectExt.ux.form.LovCombo

    【讨论】:

      【解决方案2】:
      return new Ext.form.ComboBox({
                                  fieldLabel: fieldLabel,
                                  hiddenName: name,
                                  store: store ,
                                  valueField:'value',
                                  displayField:'value',
                                  typeAhead: true,
                                  mode: 'local',
                                  triggerAction: 'all',
                                  emptyText:'Select '+fieldLabel+' ...',
                                  selectOnFocus:true,
                                  allowBlank:allowBlank,
                                  forceSelection : true,
                                  disabled:disabled,
                                  multiSelect:true,
                                  width:200,
                                  id:id,
                                  listeners:{
                                      change : function( frm, newValue, oldValue ) {
                                          doRenderTL();
                                      }
                                  },
                                  renderTo: Ext.get( renderTo )
                              });
      

      【讨论】:

      • 欢迎来到 StackOverflow 并感谢您帮助回答问题!建议不仅要提供代码,还要提供一些关于你的答案的解释。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-28
      • 1970-01-01
      • 2018-10-24
      • 2021-05-01
      • 2011-08-19
      • 1970-01-01
      相关资源
      最近更新 更多