zoukankan      html  css  js  c++  java
  • extjs combo中给Store插入一条数据

    {
    xtype: 'combo',
    columnWidth: .55,
    name: 'AQLLevel',
    store: Ext.create('Scripts.Code.Common.store.InspLevelSwitchingStore'),
    editable: false,
    queryMode: 'local',
    matchFieldWidth: false,
    listConfig: { 200 },
    valueField: 'COMM_CODE',
    displayField: 'COMM_CODE_NM',
    listeners:
    {
    render: function (com) {
    var store = com.getStore();
    store.load({
    callback: function () {
    var data = [{ COMM_CODE: '', COMM_CODE_NM: 'ALL' }];
    if (store.data.items.length > 0) {
    if (store.getAt(0).data.COMM_CODE_NM != 'ALL') {
    store.insert(0, data);
    }
    } else {
    store.insert(0, data);
    };
    com.select(store.data.items[0]);
    }
    });
    },
    expand: function (field, eOpts) {
    var store = field.getStore();
    var data = [{ COMM_CODE: '', COMM_CODE_NM: 'ALL' }];
    if (store.data.items.length > 0) {
    if (store.getAt(0).data.COMM_CODE_NM != 'ALL') {
    store.insert(0, data);
    }
    } else {
    store.insert(0, data);
    };
    }
    }//end listeners
    }

  • 相关阅读:
    mysql高并发配置
    php xml转array的方法
    双系统,一系统损坏后的解决方案之硬盘启动
    最长公共前缀
    罗马数字转整数
    回文数
    整数反转
    一、数组---两数之和
    从尾到头打印链表
    替换空格
  • 原文地址:https://www.cnblogs.com/hqyj/p/7395790.html
Copyright © 2011-2022 走看看