bootstrap-selectpicker

Trying to set data-live-search to select-picker

非 Y 不嫁゛ 提交于 2021-01-29 07:49:35
问题 selectpicker $('.selectpicker').selectpicker(); $("#s1").addClass("btn-sm"); //set to current value$("#s1").selectpicker('val', picker[0]["f_name"]); $("#s1").selectpicker("refresh"); select picker css <div id="input1" style="margin-bottom: 50px"> <div class="pull-left" style="width: 250px;"> <select class="selectpicker" data-live-search="true" id="s1"> </select> This is my code. I want to set a search in my select picker. What should I do? 回答1: <div class="live-search" > <select class=

Selectpicker with add or delete values

泪湿孤枕 提交于 2021-01-29 02:19:47
问题 I've got a bootstrap selectpicker. I've got a list of timeRange values. <select class="selectpicker"> <option data-icon="" value="00:00-23:59">All Day (12am-11:59pm)</option> <option data-icon="fa fa-coffee" value="05:00-08:59">Morning (5am-8:59am)</option> <option data-icon="fa fa-briefcase" value="09:00-16:59">Business Hours (9am-4:59pm</option> <option data-icon="fa fa-moon-o" value="17:00-20:59">Evening (5pm-8:59pm)</option> <option data-icon="fa fa-clock-o" value="00:00-11:59">AM Hours

Bootstrap-select add actions based on selected options using jQuery

血红的双手。 提交于 2021-01-28 18:21:33
问题 I have a bootstrap-select and I want to add conditions based on user interaction. If user opens the dropdown and on close the user : selected different value(s) comparing to the initial value(s) on show, it will alert 'value changed' kept the current value(s) equal to initial value(s) on show, it will alert 'same value' doesn't select any option, it will alert 'no value' Please find below a simple demo with an explanation. I couldn't figure out it why my logic is not working properly. What I

How to set multiple selected values for multi-select picker?

杀马特。学长 韩版系。学妹 提交于 2021-01-28 09:10:43
问题 I have the following multi-select picker which is populated with data. I want to be able to set multiple selected values that I get from the database. <div class="form-group col-md-6 col-lg-6 col-sm-6"> <label>Choose Skills</label> <select id="DDLSkills" name="selValue" data-live-search="true" data-style="btn-default form-control" class="selectpicker form-control" data-size="5" multiple data-max-options="2"></select> </div> This is the code that I use to populate the multi-select picker: $('

Django - How to pass multiple selected values from selectpicker from template to views.py

孤者浪人 提交于 2021-01-07 02:49:43
问题 I have a multiselect dropdown (select class="selectpicker" multiple) in my template. I want to transfer the selected values to my search function in views.py so that I can use those parameters to apply queries on my database table and then route the user to Listings page based on search parameters selected. Please see below my code. Can you please assist as to what I am doing wrong: Template file: Colony (All) {% for key,value in colony_choices.items %} {{ value }} {% endfor %} views.py: if

Django - How to pass multiple selected values from selectpicker from template to views.py

拟墨画扇 提交于 2021-01-07 02:49:19
问题 I have a multiselect dropdown (select class="selectpicker" multiple) in my template. I want to transfer the selected values to my search function in views.py so that I can use those parameters to apply queries on my database table and then route the user to Listings page based on search parameters selected. Please see below my code. Can you please assist as to what I am doing wrong: Template file: Colony (All) {% for key,value in colony_choices.items %} {{ value }} {% endfor %} views.py: if

Bootstrap selectpicker search box font size

依然范特西╮ 提交于 2020-01-06 05:40:10
问题 Is it possible to change font size of the search box in Bootstrap select? <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <select class="selectpicker" data-live-search="true"> <option>Option 1</option> <option>Option 2</option> </select> 回答1: Bootstrap-Select generates some HTML for you, so the thing you want is to inspect the HTML

Different height of select with HTML5 and Bootstrap Select

大憨熊 提交于 2019-12-13 05:24:26
问题 I have a HTML select element that uses Bootstrap Select. If I use HTML5, the button element, that is generated by Boostrap Select to render the select, has a correct height of 24. If I do not use HTML5, it then has a height of 8.875 on Blink (Opera 56.0) and of 8.8833 on Gecko (Firefox 60.3,) resulting in a broken display. By using HTML5, I mean having (or not) the DOCTYPE <!doctype html> as the first line (no server config as I tested from files on the FS). Any idea of what precisely is

SelectPicker - Select option Live search if the result doesn't match by bootstrap-select

怎甘沉沦 提交于 2019-12-13 03:34:03
问题 I want to display other for default and enable to select. The case is if we type and didn't match between the result and option. $('.selectpicker').selectpicker({ noneResultsText: 'I found no results' }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.js"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.css" rel=

Problem with sintax of selectpicker('refresh')

ぃ、小莉子 提交于 2019-12-13 03:23:27
问题 I try to populate a select form with data from a json file. [{"matricola":"1", "nome":"aaaaa"},{"matricola":"2", "nome":"bbbbbb"}] If I use select it works, if i try to use selectpicker I do not understand where I have to refresh the selectpicker in my javascript code. Here my code: <div class="form-group "> <select id="cf" class="selectpicker show-tick form-control" data-dropup-auto="false" data-live-search="true" required="" name="cf"> </select> </div> <script> let dropdown = document