zoukankan      html  css  js  c++  java
  • combobox 的onLoadSuccess执行两次解决办法和 取值赋值

    加红色字部分

    jsp

    <input class="easyui-combobox" id="keshi" name="keshi" value="${tPetitionReport.keshi}" />


    js

    整体关键代码示例如下:

      

    $('#keshi').combobox({
    url: '/ccewis/xffy/keshiList',
    valueField: 'id',
    textField: 'groupName',
    multiple:true,
    //tableWidth*0.17,
    editable: true,
    filter: function (q, row) {
    var opts = $(this).combobox("options");
    return row[opts.textField].indexOf(q) > -1;//将从头位置匹配改为任意匹配
    },
    onLoadSuccess: function () { //下拉框数据加载成功调用
    var values = $(this).combobox('getValues').join(',');//获取选中的值的values
    $(this).combobox('setValues',values.split(',')); //http://www.verydemo.com/demo_c110_i7529.html
        },
    onSelect: function (rec) {
    var keshiId = encodeURIComponent(rec.id);
    //$('#visibleMan').combobox('clear');
    $('#visibleMan').combobox('reload', '/ccewis/xffy/userList?keshiId=' + keshiId);
    },
    onChange: function (newValue, oldValue) {
    if (newValue == "") {
    $('#visibleMan').combobox('clear').combobox('reload', '/ccewis/xffy/userList');
    }
    }
    });
  • 相关阅读:
    U-Boot新手入门
    安装交叉编译工具
    Makefile 工程管理
    gcc基本用法
    poj 3264 Balanced Lineup
    hdoj 1166 敌兵布阵
    poj 1363 Rails
    poj 1028 Web Navigation
    zoj 3621 Factorial Problem in Base K
    poj1861最小生成树
  • 原文地址:https://www.cnblogs.com/xlj227/p/6393494.html
Copyright © 2011-2022 走看看