小编sil*_*.it的帖子

x-editable + bootstrap 3 + Twitter typeahead.js无效

我试图将Bootstrap3与令人敬畏的x-editable和typeahead.js集成,但我无法使其工作:

我尝试了以下内容

  • 使用data-type ='typeaheadjs'标记元素
  • 将type ='typeaheadjs'添加到$().editable()
  • 将所有参数移动到data-*属性
  • 将所有参数移动到$().editable()参数

但没有运气.

HTML代码:

<div style="margin: 150px">
    <a href="#" id="username">Rome</a>
</div>
Run Code Online (Sandbox Code Playgroud)

JS代码:

$('#username').editable({
    mode: 'inline',
    showbuttons: false,
    type: 'text',
    url: '/post',
    pk: 1,
    title: 'Enter an Italian city',
    typeahead: {
        local: ['Rome', 'Milan', 'Venice', 'Florence']
    }
});        
Run Code Online (Sandbox Code Playgroud)

在这里小提琴:http://jsfiddle.net/Ggxbm/3/

甚至http://vitalets.github.io/x-editable/docs.html#typeaheadjs提供的例子也不适用于我

我究竟做错了什么?

javascript typeahead.js x-editable twitter-bootstrap-3

6
推荐指数
1
解决办法
4394
查看次数