zoukankan      html  css  js  c++  java
  • easyui commbox嵌入一个checkbox的实现

    function InitComBoBox(datagrid, combxid, formid, url, valueField, textField,_prompt) {
    $(combxid).combobox({
    url: Medicom.url + url,
    method: 'get',
    valueField: valueField,
    textField: textField,
    panelHeight: 'auto',
    multiple: true,
    200,
    editable: false,
    prompt: _prompt,
    formatter: function (row) {
    var opts = $(this).combobox('options');
    return '<label><input type="checkbox" class="combobox-checkbox"> ' + row[opts.textField] + '</label>'
    },
    onShowPanel: function () {
    var opts = $(this).combobox('options');
    var target = this;
    var values = $(target).combobox('getValues');
    $.map(values, function (value) {
    var el = opts.finder.getEl(target, value);
    el.find('input.combobox-checkbox')._propAttr('checked', true);
    })
    },
    onHidePanel: function () {
    //提交给后台进行查询
    },
    onLoadSuccess: function () {
    var opts = $(this).combobox('options');
    var target = this;
    var values = $(target).combobox('getValues');
    $.map(values, function (value) {
    var el = opts.finder.getEl(target, value);
    el.find('input.combobox-checkbox')._propAttr('checked', true);
    })
    },
    onSelect: function (row) {
    var opts = $(this).combobox('options');
    var el = opts.finder.getEl(this, row[opts.valueField]);
    el.find('input.combobox-checkbox')._propAttr('checked', true);
    },
    onUnselect: function (row) {
    var opts = $(this).combobox('options');
    var el = opts.finder.getEl(this, row[opts.valueField]);
    el.find('input.combobox-checkbox')._propAttr('checked', false);
    }
    });
    }

  • 相关阅读:
    UVA10340
    声明顺序 (Bootstrap 编码规范)
    使用SVN小结
    通过LINQ TO SQL类显示数据库表的数据
    大学初进团队感想
    51NOD:1639-绑鞋带
    Codeforces Round #464 (Div. 2) E. Maximize!
    Codeforces Round #464 (Div. 2) D. Love Rescue
    Codeforces Round #464 (Div. 2) C. Convenient For Everybody
    Codeforces Round #464 (Div. 2) B. Hamster Farm
  • 原文地址:https://www.cnblogs.com/huangf714/p/6092978.html
Copyright © 2011-2022 走看看