我对Select2有问题。一切正常,除了我无法选择任何选项。我正在使用 select2 3.5.3、KnockoutJS、CoffeeScript 和 JQuery。我的 select2 代码:
generateSelect3 =->
return '<input data-bind="select2: {
data:{ results: _.available, text: \'text\'},
minimumInputLength: 3,
allowClear: true,
}" class="select2"></select>'
所有文件都被调用。我有定制的 select2。它的初始化代码:
generateSelect2 =->
return $('<div class="subcontainer"><input type="text" class="input-
xxlarge" data-bind="select2ex: {url: (_.params && _.params.url ||
undefined), value: value, text: text, options: _.params}"></div>');
问题解决了:
return $('<div class="subcontainer"><select
class="input-xxlarge"
data-bind="options: _.available,
optionsText: $.ehr.CodedWidget.formatSelectText,
optionsValue: function(item) {
return item && item.value || (item.value == 0 ? item.value + \'\' : \'\') },
select2ex: {
value: value,
}"></select></div>')
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句