twitter bootstrap - javascript selectpicker doesn't work -


i'm using bootstrap-sass , want use selectpicker search doesn't work !!

this application.js

//= require rails-ujs //= require turbolinks //= require jquery3 //= require jquery_ujs //= require jquery.min.js //= require bootstrap.min.js //= require bootstrap-datepicker //= require_tree . 

this application.js

 *= require_tree .  *= require_self  *= require bootstrap-datepicker3  */   @import "bootstrap-sprockets";  @import "bootstrap"; 

and view

<div class="container">   <div class="row">     <h2>bootstrap-select example</h2>     <hr />   </div>    <div class="row-fluid">     <select class="selectpicker" data-show-subtext="true" data-live-search="true">       <option data-subtext="rep california">tom foolery</option>       <option data-subtext="sen california">bill gordon</option>       <option data-subtext="sen massacusetts">elizabeth warren</option>       <option data-subtext="rep alabama">mario flores</option>       <option data-subtext="rep alaska">don young</option>       <option data-subtext="rep california" disabled="disabled">marvin martinez</option>     </select>   </div> </div> 

here have working example. thing probleme come js/css import.

$('.selectpicker').selectpicker({    style: 'btn-info',    size: 4  });
<!-- jquery -->  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>    <!-- bootstrap js -->  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>    <!-- bootstrap css -->  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>    <!-- bootstrap-select css -->  <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/css/bootstrap-select.min.css" rel="stylesheet"/>    <!-- bootstrap-select js -->  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/js/bootstrap-select.min.js"></script>      <div class="container">    <div class="row">      <h2>bootstrap-select example</h2>    </div>      <div class="row-fluid">      <select class="selectpicker" data-show-subtext="true" data-live-search="true">        <option data-subtext="rep california">tom foolery</option>        <option data-subtext="sen california">bill gordon</option>        <option data-subtext="sen massacusetts">elizabeth warren</option>        <option data-subtext="rep alabama">mario flores</option>        <option data-subtext="rep alaska">don young</option>        <option data-subtext="rep california" disabled="disabled">marvin martinez</option>      </select>    </div>  </div>


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -