Reputation: 36217
I'm trying to implement The x-editible library by following the docs at http://vitalets.github.io/x-editable/docs.html. i have loaded my codeigniter view with the following table filled with info from a single database table record:
<table id="myDataTable" class="table table-bordered table-striped" style="clear: both">
<tbody>
<tr><td>id</td><td><a href="#" id="id" data-type="text" data-pk="2" data-url="/post" data-title="id">2</a></td></tr>
<tr><td>email</td><td><a href="#" id="email" data-type="text" data-pk="2" data-url="/post" data-title="email">[email protected]</a></td></tr>
.....
.....
<script src='js/jquery.js'></script>
<script src="js/bootstrap.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.4.5/bootstrap-editable/js/bootstrap-editable.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$('#myDataTable').editable();
$.fn.editable.defaults.mode = 'inline';
});
</script>
However when I click on the link in the table,like in http://vitalets.github.io/x-editable/demo.html the plugin does not fire. I see no errors in firebug. What am I doing wrong?
Upvotes: 0
Views: 58
Reputation: 54619
You need to apply the plugin to your links, not the table, use:
$('#myDataTable a').editable();
Upvotes: 1