zoukankan      html  css  js  c++  java
  • 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;'
    },

  • 相关阅读:
    python (八)迭代器、生成器、列表推导式
    python (七)装饰器
    HTML基础 (一)
    jQuery(一)
    JavaScript 练习(二)事件
    DOM节点(二)
    git操作顺序
    VUE练习(二)解决Bug
    前端环境VSCode
    JavaScript 基础基础最基础
  • 原文地址:https://www.cnblogs.com/hqyj/p/5649977.html
Copyright © 2011-2022 走看看