• Extjs combobox


      

    {
    xtype: 'combo',
    name: 'PART_BRAND',
    fieldLabel: '品牌',
    margin: '0 5 5 0',
    allowBlank: false,
    editable: true,
    autoSelect: true,
    forceSelection: true,
    selectOnFocus: true,
    typeAhead: true,
    hiddenName: 'para_name',
    queryParam: 'PARA_NAME',//后台传值
    valueField: "PARA_ID",
    displayField: "PARA_NAME",
    store: Ext.create('Scripts.BasicData.D_PARTS.store.GParaStore'),
    queryMode: 'local',
    minChars: 0,
    //ref: '../param',
    //weight: 50,
    maxLength: 20,
    listeners: {
    render: function (combo, eOpts) {
    var store = combo.getStore();
    store.proxy.extraParams = {
    para_type: '品牌'
    }
    store.load({
    //params: { type: '包装类型' },
    callback: function (records, options, success) {
    // combo.setValue(records[0]);///默认选择第一条
    }
    });
    },
    beforequery: function (e) { // 匹配输入
    var combo = e.combo;
    if (!e.forceAll) {
    var value = e.query;
    combo.store.filterBy(function (record, id) {
    var text = record.get(combo.displayField);
    return (text.indexOf(value) != -1);
    });
    combo.expand();
    return false;
    }
    }
    //,
    //change: function (combo, newValue, oldValue, eOpts) {

    // var v_store = combo.getStore();
    // var bb = combo.getValue();
    // if (bb == null) {
    // bb = 'CNTSN';// v_store.data.items[0].data.PARA_ID;
    // }
    // var vindex = v_store.find("PARA_ID", bb);
    // var record = v_store.getAt(vindex);
    // combo.up("fieldset").down("textfield[name=POR_DESC]").setValue(record.data.PARA_NAME);
    //}
    },
    columnWidth: .49
    // ,
    //// readOnly: true,
    //fieldStyle: 'background-color: #EDEDED; background-image: none;'
    },

  • 相关阅读:
    关于此主题 v1
    从博客园主题了解前端 CSS
    VS2019 许可证到期
    从博客园主题了解前端 HTML
    关于此主题
    从博客园主题了解前端 JS
    GCC 编译器
    Python的Set和List的性能比较 + 两者之间的转换
    wsgi初探(转)
    权限设计概要
  • 原文地址:https://www.cnblogs.com/hqyj/p/5649977.html
Copyright © 2020-2023  润新知