wenzhixin bootstrap-table无法点击select2

这是问题所在,并在Codeply中整理了一个模型http://www.codeply.com/go/rxWzeVwBUa 。

我无法点击带有数据表的Select2下拉框。 任何帮助,将不胜感激。

From data

ID Item Name Item 0 ... Item Price
$table.bootstrapTable({ data: data}); }); $('#finditem').select2({ placeholder: 'Find Item', allowClear: true });

我把它发布到github上的开发人员,开发人员发布了解决方案;

https://github.com/wenzhixin/bootstrap-table/issues/1254#issuecomment-130358202 http://www.codeply.com/go/e4LJoKfhdR

 $table.on('post-header.bs.table', function () { $('.finditem').select2({ placeholder: 'Find Item', allowClear: true }); }); 

顺便说一句,我发现如果你想使用任何select2事件监听器,他们也必须放在这个函数中。 我使用一系列级联的select2框来在他们选择时自动更新表格。

  $table.on('post-header.bs.table', function () { $('.finditem').select2({ placeholder: 'Find Item', allowClear: true }); $('.finditem').on('select2:close', function(){ $table.bootstrapTable('refresh'); }); });