bootstrap-table x-editable plugin, can't set type to select -


i'm using bootstrap-table x-editable plugin, working except unable change type of input on x-editable popup. i've tried setting data-type="select" , type: 'select' shows type text

this fiddle shows issue, table should using select type not, link outside of table same options work.

<table id="table-hover" data-toggle="table" data-show-toggle="true" data-show-columns="true" data-url="/gh/get/response.json/wenzhixin/bootstrap-table/tree/master/docs/data/data1/">     <thead>         <tr>              <!-- field doesn't show select input -->             <th data-field="name" data-editable="true" data-type="select">name</th>             <th data-field="stargazers_count">stars</th>             <th data-field="forks_count">forks</th>             <th data-field="description">description</th>         </tr>     </thead> </table>  <!-- works! --> <a href="#" id="fruits" data-type="select">banana</a> 

js -

$(function () {     var $table = $('#table-hover');     $table.bootstraptable({         }).on('editable-init.bs.table', function(e){             $('.editable').editable('option', {                 type: 'select',                 title: "fruit",                 source: [                     {value: 1, text: 'banana'},                     {value: 2, text: 'peach'}                 ]             });     });     $('#fruits').editable({        type: 'select',        title: "fruit",        source: [         {value: 1, text: 'banana'},         {value: 2, text: 'peach'}        ]     }); }); 

https://jsfiddle.net/e3nk137y/2048/

bootstrap table not support using data attribute init x-editable options @ moment, can via javascript instead. see example: http://issues.wenzhixin.net.cn/bootstrap-table/#issues/986.html


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -