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'} ] }); });
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
Post a Comment