easyui editor combobox multiple

Posted 芜明-追星

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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)

}

}

});

以上是关于easyui editor combobox multiple的主要内容,如果未能解决你的问题,请参考以下文章