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;'
    },

  • 相关阅读:
    failed to push some refs to 'git@github.com:laniu/liuna.git'报错原因
    ECMAScript和JavaScript的关系
    js面试总结
    第16章 脚本化css
    代理模式
    SQL
    VS
    Js/Jquery获取iframe中的元素 在Iframe中获取父窗体的元素方法
    SQL
    C#
  • 原文地址:https://www.cnblogs.com/hqyj/p/5649977.html
Copyright © 2011-2022 走看看