Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use bootstraps x-editable in table rows?

I would like to use the bootstraps X-editable plugin. I retrieve server side data in my table and I would like to edit them in-line. As I see, X-editable is proposed to work with id's. Would be possible to handle this with multiple data?

The documentation:

<a href="#" id="username" data-type="text" data-pk="1" data-url="/post" data-title="Enter username">superuser</a>
$(document).ready(function() {
    $('#username').editable();
});


What about if I have more usernames?

like image 235
fefe Avatar asked Oct 24 '13 14:10

fefe


1 Answers

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

change to

<a href="#" class="username">superuser</a>

And

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

Change to

$(document).ready(function() {
    $('.username').editable();
});
like image 86
Chuan Avatar answered Nov 15 '22 10:11

Chuan