Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add editable to bootstrap table

I try to use bootstrap table editable. In my jsp page I have:

<div class="row mystyle" >
  <div class="col-md-10">
   <table id="mytable" class="table table-hover" id="table-pagination"
                       data-url="data.json" 
                       data-toggle="table"
                       data-pagination="true"
                       data-show-pagination-switch="true"
                       data-sort-order="desc" 
                       data-show-export="true" 
                       data-search="true" 
                       data-show-toggle="true"  
                       data-show-refresh="true" 
                       data-show-columns="true"
                       data-page-list="[10, 25, 50, 100, ALL]">

      <thead>
        <tr>
         <th data-field="id" data-align="center">id</th>
         <th data-field="type" data-align="center">type</th>
         <th data-field="quantity" data-align="right" data-sortable="true">cost</th> 
        </tr>
      </thead>
  </table>
</div>            

and my table is shown great. Now I want to add the editable method. I added the <script src="assets/js/bootstrap-table-editable.js"></script> and then how ? It isn't clear to me (I am newbie..), how I continue..

like image 367
yaylitzis Avatar asked Sep 09 '25 11:09

yaylitzis


2 Answers

You need add the bootstrap-editable.js file, because our extension is based on x-editable like the example: source.

There are other examples maybe can help you: demo1, demo2, demo3, and the docs.

like image 171
wenyi Avatar answered Sep 11 '25 00:09

wenyi


call editable by selecting your table with jquery:

var options = {};
$("#mytable").editable(options);

For the full specs and options list, check here

like image 28
taxicala Avatar answered Sep 11 '25 01:09

taxicala