我正在使用安装了 x-editable-bootstrap Meteorite(和 bootstrap)包的 Meteor。
当我设置可编辑的 select2 标签时,加载指示器会一直旋转,无法输入标签。尝试了很多,希望有人可以帮助!
在我的模板中,我有一个
<div id="editableStuff" data-title="Blah enter tags plz">Apple, Banana</div>
在我的 Template.rendered 中,我有一个 jQuery on-dom-ready 函数 à la
$(function(){
$('#editableStuff:not(.editable-click)').editable('destroy').editable({
success: function(response, newValue) {
Session.set('tmp'+name,newValue);
},
placement:'left',
select2: {
tags: ['cake', 'cookies'],
tokenSeparators: [",", " "]
},
type:'select2'
});
};
它使用虚线在页面上创建默认元素。单击该元素会出现 x-editable 弹出窗口,但它不会加载输入字段,加载指示器只是保持旋转。
控制台记录以下错误:
TypeError: 'undefined' is not a function (evaluating 'this.$input.select2(this.options.select2)')
在x-editable-bootstrap.js:3683
我发现当我type:'select2'
在editable({..})
加载文本字段中删除时,但没有标签功能。
有任何想法吗?非常感谢任何提示!使用上面的代码模式,其他 x-editable 类型就像魅力一样工作address
!text