zoukankan      html  css  js  c++  java
  • easyui editor combobox multiple

    $.extend($.fn.datagrid.defaults.editors,{
        combobox: {
            init: function(container, options){
                var combo = $('<input type="text">').appendTo(container);
                combo.combobox(options || {});
                return combo;
            },
            destroy: function(target){
                $(target).combobox('destroy');
            },
            getValue: function(target){
                var opts = $(target).combobox('options');
                if (opts.multiple){
                    return $(target).combobox('getValues').join(opts.separator);
                } else {
                    return $(target).combobox('getValue');
                }
            },
            setValue: function(target, value){
                var opts = $(target).combobox('options');
                if (opts.multiple){
                    if (value == ''){
                        $(target).combobox('clear');
                    } else {
                        $(target).combobox('setValues', value.split(opts.separator));
                    }
                } else {
                    $(target).combobox('setValue', value);
                }
            },
            resize: function(target, width){
                $(target).combobox('resize', width)
            }
        }
    });
  • 相关阅读:
    Palindrome
    Girls' research
    最长回文
    Water Tree
    Alternating Current
    Psychos in a Line
    Feel Good
    Color the Fence
    javaScript内置类Date,Math等
    DOM之兄弟节点
  • 原文地址:https://www.cnblogs.com/exmyth/p/4122850.html
Copyright © 2011-2022 走看看