• Ext 中combo的用法



    var combobox_xianqu = Ext.getCmp('combobox_id');
    var store_xianqu = Ext.data.StoreMgr.lookup('store_xianqu');
    var r = store_xianqu.getRange();
    combobox_xianqu.fireEvent('select', this, r);
    -----------在原store上插入一条数据--------
    {
    name: 'VARTYPE',
    fieldLabel: "Var Type",
    xtype: 'combo',
    autoSelect: true,
    store: 'VarTypeStore',
    editable: true,
    minChars: 1,
    weight: 50,
    labelWidth:80,
    220,
    queryParam: 'COMM_CODE',
    typeAhead: false,
    queryMode: 'local',
    valueField: 'COMM_CODE',
    displayField: 'COMM_CODE_NM',
    hiddenName: 'COMM_CODE',
    margin: '5 5 5 10',
    listeners: {
    'render': function (com) {
    var store = com.getStore();
    store.on('load', function (store, record) {
    var data = [{
    COMM_CODE: '',
    COMM_CODE_NM: 'ALL'
    }];
    if (store.getAt(0).data.Model != 'ALL') {
    store.insert(0, data);
    com.setValue('');
    }
    });
    }
    }
    }

     ----------------------输入字符后查询-------------------------------

    {
    xtype: 'combo',
    fieldLabel: 'Model Code',
    columnWidth: .23,
    allowBlank: false,
    name: 'ModelCode',
    store: 'ModelCodeRegisterStore',
    editable: true,
    enableKeyEvents: true, -------支持键盘
    minChars: 30,
    typeAhead: true,
    queryMode: 'local',
    valueField: 'MODEL_CODE',
    displayField: 'MODEL_CODE',
    listeners: {
    keydown: function (th, e, eOpts) {
    if (e.keyCode == 13) { ---回车
    if (typeof (th.getPicker().pickerField.isExpanded) == 'undefined' || th.getPicker().pickerField.isExpanded == false || (th.getPicker().pickerField.isExpanded == true && typeof (th.getPicker().highlightedItem) == 'undefined')) {
    th.store.proxy.extraParams = {
    Material: th.up("window").down('checkbox[name=Material]').getValue(),
    ModelCode: th.getValue()
    };
    th.store.load({
    callback: function (records, options, success) {
    th.expand();
    th.focus();
    }
    });
    }
    }
    }
    }

    --------

    {
    xtype: 'combo',
    flex: .7,
    name: 'FromPoint',
    forceSelection: false,
    value: '',
    editable: false,
    typeAhead: false,
    store: Ext.create("Scripts.Code.MDM.Logistic.Delivery.DeliveryAttribute.store.FromPointStore"),
    tpl: Ext.create('Ext.XTemplate',
    '<tpl for=".">',
    '<div class="x-boundlist-item">{COMM_CODE}:{COMM_CODE_NM}</div>',
    '</tpl>'
    ),
    queryMode: 'local',
    queryParam: 'COMM_CODE',
    valueField: 'COMM_CODE',
    displayField: 'COMM_CODE_NM',
    hiddenName: 'COMM_CODE',
    listeners: {
    change: function (combo, newValue, oldValue, eOpts) {
    var form = combo.up("form");
    form.down("combo[name=ToPoint]").setValue("");
    var obj = form.getForm().getValues();
    //console.log(obj);
    var to_store = Ext.getStore("ToPointStore");
    to_store.proxy.extraParams = obj;
    to_store.load();
    }
    }
    }

    combo设置下拉列表宽度:
    matchFieldWidth: false,//此处要有
    listConfig: { 200 },

  • 相关阅读:
    【json的处理】一、Gson处理
    【校验处理】三、Spring Validation 校验处理
    【校验处理】二、SpringBoot Validate 统一处理
    【校验处理】一、Java Bean Validation验证
    div 固定宽高 水平垂直居中方法
    vue 修改ElementUI样式(非全局修改)
    js --- execCommand('copy')复制文本到剪切板换行符不生效
    C#枚举(一)使用总结以及扩展类分享
    php执行时长
    关于PHP的编码格式导致的乱码
  • 原文地址:https://www.cnblogs.com/hqyj/p/6635108.html
Copyright © 2020-2023  润新知