1

I want to make a simple use of the plugin x-editable, following step by step what's to do in the official doc.

It actualy worked fine when I was on Bootstrap 2, though, it doesn't work anymore on BS3 (even if I updated everything to the latest version etc.).

So when I click on the link to trigger the editable popover, I got this error in firebug :

TypeError: this.$element.data(...) is undefined
[...]/Bootstrap3/js/bootstrap-editable.js
Line 154

Which is actually this line :

this.$element.data('popover').tip().addClass('editable-popover');

Btw, I'm using CakePHP, all the plugins (js and CSS) are declared etc...

So I'm running out of idea, if someone knows about it, would be cool !

Thanks !

EDIT : Problem solved, just had to reload the cache... Old script was still in it so there was compatibility problems.

4

1 回答 1

1

您是否从以下网址下载了最新的 Bootstrap 3 就绪版本:http: //vitalets.github.io/x-editable/assets/zip/bootstrap3-editable-1.5.0.zip

按照http://vitalets.github.io/x-editable/docs.html的步骤,我没有发现任何问题。见:http: //jsfiddle.net/xaRbU/

请注意示例使用 jquery-2.0.3(上面的小提琴适用于 1.9.1)。由于 jQuery 2 不支持 IE8 Bootstrap 需要最新的 1.x 版本的 jQuery,另请参阅:将 Bootstrap 更新到版本 3 - 我需要做什么?

使用的代码:

html:

<div class="container">
<div class="row">
    <a href="#" id="username" data-type="text" data-pk="1" data-url="/post" data-title="Enter username">superuser</a>
</div>
</div>

javascript:

$(document).ready(function() {
    $('#username').editable();

});

CSS:

/* create some space cause the popup shows on the top of the element */
body{padding-top:100px;}
于 2013-10-10T11:05:20.900 回答