jQuery插件可过滤Bootstrap5/4下拉选择 Bootstrap选择

  • 源码大小:1.1MB
  • 所需积分:1积分
  • 源码编号:19JP-3605
  • 浏览次数:752次
  • 最后更新:2023年07月01日
  • 所属栏目:表单
我要下载
加入收藏
本站默认解压密码:19jp.com 或 19jp_com

简介

Bootstrap Select是一个jQuery插件,通过多种选项增强默认的Bootstrap下拉选择,如:optgoup支持、自动完成、清除选择和实时过滤。

依赖项:

  • jQuery中。
  • Bootstrap程序5、Bootstrap程序4或Bootstrap程序3
  • 字体很棒的图标(适用于Bootstrap程序4)。
  • AjaxBootstrap选择(用于Ajax数据获取)。可选。

安装:

  1. # Yarn
  2. $ yarn add bootstrap-select
  3.  
  4. # NPM
  5. $ npm install bootstrap-select --save

如何使用它:

1.将jQuery Bootstrap Select插件和其他所需资源包含到您的Bootstrap页面中。

  1. <!-- Bootstrap Stylesheet -->
  2. <link rel="stylesheet" href="/path/to/cdn/bootstrap.min.css" />
  3.  
  4. <!-- Bootstrap Select Stylesheet -->
  5. <link href="/path/to/bootstrap-select.min.css" rel="stylesheet">
  6.  
  7. <!-- Bootstrap JavaScript -->
  8. <script src="/path/to/cdn/jquery.slim.min.js"></script>
  9. <script src="/path/to/cdn/bootstrap.min.js"></script>
  10.  
  11. <!-- Bootstrap Select Main JavaScript -->
  12. <script src="/path/to/bootstrap-select.min.js"></script>
  13.  
  14. <!-- Bootstrap Select Language JavaScript -->
  15. <script src="/path/to/i18n/defaults-LANGUAGE.min.js"></script>

2.只需将类“selectpicker”添加到您的select元素中即可。

  1. <select class="selectpicker">
  2. <option>1</option>
  3. <option>2</option>
  4. <option>3</option>
  5. <option>4</option>
  6. <option>5</option>
  7. </select>

3.您也可以通过调用“select”元素上的函数来初始化插件。

  1. $('select').selectpicker();

4.所有默认插件设置。

  1. $('select').selectpicker({
  2.  
  3. // text for none selected
  4. noneSelectedText: 'Nothing selected',
  5.  
  6. // text for no results
  7. noneResultsText: 'No results matched {0}',
  8. countSelectedText: function (numSelected, numTotal) {
  9. return (numSelected == 1) ? "{0} item selected" : "{0} items selected";
  10. },
  11.  
  12. // text for max options
  13. maxOptionsText: function (numAll, numGroup) {
  14. return [
  15. (numAll == 1) ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)',
  16. (numGroup == 1) ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)'
  17. ];
  18. },
  19.  
  20. // text for select all
  21. selectAllText: 'Select All',
  22.  
  23. // text for deselect all
  24. deselectAllText: 'Deselect All',
  25.  
  26. // enables done button
  27. doneButton: false,
  28.  
  29. // text for done button
  30. doneButtonText: 'Close',
  31.  
  32. // custom separator
  33. multipleSeparator: ', ',
  34.  
  35. // basic class
  36. styleBase: 'btn',
  37.  
  38. // button classes
  39. style: classNames.BUTTONCLASS,
  40.  
  41. // 'auto' | integer | false
  42. size: 'auto',
  43.  
  44. // title for dropdown select
  45. title: null,
  46.  
  47. // values' | 'static' | 'count' | 'count > x'
  48. selectedTextFormat: 'values',
  49.  
  50. // width
  51. width: false,
  52.  
  53. // string | false
  54. container: false,
  55.  
  56. // hides disabled options
  57. hideDisabled: false,
  58.  
  59. // shows sub text
  60. showSubtext: false,
  61.  
  62. // shows icons
  63. showIcon: true,
  64.  
  65. // shows content
  66. showContent: true,
  67.  
  68. // auto reposition to fit screen
  69. dropupAuto: true,
  70.  
  71. // adds a header to the dropdown select
  72. header: false,
  73.  
  74. // live filter options
  75. liveSearch: false,
  76. liveSearchPlaceholder: null,
  77. liveSearchNormalize: false,
  78. liveSearchStyle: 'contains',
  79.  
  80. // shows Select All & Deselect All
  81. actionsBox: false,
  82.  
  83. // icon base
  84. iconBase: 'glyphicon',
  85.  
  86. // tick icon
  87. tickIcon: 'glyphicon-ok',
  88.  
  89. // shows tick
  90. showTick: false,
  91.  
  92. // custom template
  93. template: {
  94. caret: '<span class="caret"></span>'
  95. },
  96.  
  97. // integer | false
  98. maxOptions: false,
  99.  
  100. // enables the device's native select for the dropdown select
  101. mobile: false,
  102.  
  103. // if true, treats the tab character like the enter or space characters within the selectpicker dropdown.
  104. selectOnTab: false,
  105.  
  106. // boolean | 'auto'
  107. dropdownAlignRight: false,
  108.  
  109. // padding
  110. windowPadding: 0,
  111.  
  112. // If enabled, the items in the dropdown will be rendered using virtualization (i.e. only the items that are within the viewport will be rendered).
  113. // This drastically improves performance for selects with a large number of options.
  114. // Set to an integer to only use virtualization if the select has at least that number of options.
  115. virtualScroll: 600
  116. });

5.API方法。

  1. // Sets the selected value
  2. $('.selectpicker').selectpicker('val', 'Mustard');
  3. $('.selectpicker').selectpicker('val', ['Mustard','Relish']);
  4.  
  5. // Selects all items
  6. $('.selectpicker').selectpicker('selectAll');
  7.  
  8. // Deselects all items
  9. $('.selectpicker').selectpicker('deselectAll');
  10.  
  11. // Re-renders the plugin
  12. $('.selectpicker').selectpicker('render')
  13.  
  14. $('.selectpicker').selectpicker('render');
  15.  
  16. // Enables mobile scrolling
  17. $('.selectpicker').selectpicker('mobile')
  18.  
  19. // Modifies the class(es)
  20. $('.selectpicker').selectpicker('setStyle')
  21. // Replace Class
  22. $('.selectpicker').selectpicker('setStyle', 'btn-danger');
  23. // Add Class
  24. $('.selectpicker').selectpicker('setStyle', 'btn-large', 'add');
  25. // Remove Class
  26. $('.selectpicker').selectpicker('setStyle', 'btn-large', 'remove');
  27.  
  28. // Programmatically updates a select
  29. $('.selectpicker').selectpicker('refresh')
  30.  
  31. // Programmatically toggles the select
  32. $('.selectpicker').selectpicker('toggle')
  33.  
  34. // Hides the select
  35. $('.selectpicker').selectpicker('hide')
  36.  
  37. // Shows the select
  38. $('.selectpicker').selectpicker('show')
  39.  
  40. // Destroy the select
  41. $('.selectpicker').selectpicker('destroy')

6.可用的事件处理程序。

  1. $('.selectpicker').on('changed.bs.select', function (e, clickedIndex, isSelected, previousValue) {
  2. // do something...
  3. });
  4.  
  5. $('.selectpicker').on('show.bs.select', function (relatedTarget) {
  6. // do something...
  7. });
  8.  
  9. $('.selectpicker').on('shown.bs.select', function (relatedTarget) {
  10. // do something...
  11. });
  12.  
  13. $('.selectpicker').on('hide.bs.select', function (relatedTarget) {
  14. // do something...
  15. });
  16.  
  17. $('.selectpicker').on('hidden.bs.select', function (relatedTarget) {
  18. // do something...
  19. });
  20.  
  21. $('.selectpicker').on('loaded.bs.select', function () {
  22. // do something...
  23. });
  24.  
  25. $('.selectpicker').on('rendered.bs.select', function () {
  26. // do something...
  27. });
  28.  
  29. $('.selectpicker').on('refreshed.bs.select', function () {
  30. // do something...
  31. });

7.要使用远程数据源,您需要在文档中加载Ajax Bootstrap Select扩展。

  1. <link rel="stylesheet" href="/dist/css/ajax-bootstrap-select.css"/>
  2. <script src="/dist/js/ajax-bootstrap-select.js"></script>

8.添加数据实时搜索属性。

  1. <select id="selectpicker" class="selectpicker" data-live-search="true">
  2. ...
  3. </select>

9.使用AJAX从远程数据源获取选项的示例JavaScript。

  1. var options = {
  2. ajax : {
  3. url : '/ajax',
  4. type : 'POST',
  5. dataType: 'json',
  6. // Use "{{{q}}}" as a placeholder and Ajax Bootstrap Select will
  7. // automatically replace it with the value of the search query.
  8. data : {
  9. q: '{{{q}}}'
  10. }
  11. },
  12. locale : {
  13. emptyTitle: 'Select and Begin Typing'
  14. },
  15. log : 3,
  16. preprocessData: function (data) {
  17. var i, l = data.length, array = [];
  18. if (l) {
  19. for (i = 0; i < l; i++) {
  20. array.push($.extend(true, data[i], {
  21. text : data[i].Name,
  22. value: data[i].Email,
  23. data : {
  24. subtext: data[i].Email
  25. }
  26. }));
  27. }
  28. }
  29. // You must always return a valid array when processing data. The
  30. // data argument passed is a clone and cannot be modified directly.
  31. return array;
  32. }
  33. };
  34. $('.selectpicker').selectpicker().filter('.with-ajax').ajaxSelectPicker(options);

10.自定义Ajax Bootstrap Select扩展的所有可能选项。

  1. /**
  2. * @member $.fn.ajaxSelectPicker.defaults
  3. * @deprecated Since version `1.2.0`, see: {@link $.fn.ajaxSelectPicker.defaults#preprocessData}.
  4. * @cfg {Function} ajaxResultsPreHook
  5. */
  6.  
  7. /**
  8. * @member $.fn.ajaxSelectPicker.defaults
  9. * @cfg {Object} ajax (required)
  10. * @markdown
  11. * The options to pass to the jQuery AJAX request.
  12. *
  13. * ```js
  14. * {
  15. * url: null, // Required.
  16. * type: 'POST',
  17. * dataType: 'json',
  18. * data: {
  19. * q: '{{{q}}}'
  20. * }
  21. * }
  22. * ```
  23. */
  24. ajax: {
  25. url: null,
  26. type: 'POST',
  27. dataType: 'json',
  28. data: {
  29. q: '{{{q}}}'
  30. }
  31. },
  32.  
  33. /**
  34. * @member $.fn.ajaxSelectPicker.defaults
  35. * @cfg {Number} minLength = 0
  36. * @markdown
  37. * Invoke a request for empty search values.
  38. */
  39. minLength: 0,
  40.  
  41. /**
  42. * @member $.fn.ajaxSelectPicker.defaults
  43. * @cfg {String} ajaxSearchUrl
  44. * @deprecated Since version `1.2.0`, see: {@link $.fn.ajaxSelectPicker.defaults#ajax}.
  45. */
  46.  
  47. /**
  48. * @member $.fn.ajaxSelectPicker.defaults
  49. * @cfg {String} bindEvent = "keyup"
  50. * @markdown
  51. * The event to bind on the search input element to fire a request.
  52. */
  53. bindEvent: 'keyup',
  54.  
  55. /**
  56. * @member $.fn.ajaxSelectPicker.defaults
  57. * @cfg {Boolean} cache = true
  58. * @markdown
  59. * Cache previous requests. If enabled, the "enter" key (13) is enabled to
  60. * allow users to force a refresh of the request.
  61. */
  62. cache: true,
  63.  
  64. /**
  65. * @member $.fn.ajaxSelectPicker.defaults
  66. * @cfg {Boolean} clearOnEmpty = true
  67. * @markdown
  68. * Clears the previous results when the search input has no value.
  69. */
  70. clearOnEmpty: true,
  71.  
  72. /**
  73. * @member $.fn.ajaxSelectPicker.defaults
  74. * @cfg {Boolean} clearOnError = true
  75. * @markdown
  76. * Clears the select list when the request returned with an error.
  77. */
  78. clearOnError: true,
  79.  
  80. /**
  81. * @member $.fn.ajaxSelectPicker.defaults
  82. * @cfg {Boolean} debug
  83. * @deprecated Since version `1.2.0`, see: {@link $.fn.ajaxSelectPicker.defaults#log}.
  84. */
  85.  
  86. /**
  87. * @member $.fn.ajaxSelectPicker.defaults
  88. * @cfg {Boolean} emptyRequest = false
  89. * @markdown
  90. * Invoke a request for empty search values.
  91. */
  92. emptyRequest: false,
  93.  
  94. /**
  95. * @member $.fn.ajaxSelectPicker.defaults
  96. * @cfg {Object} ignoredKeys
  97. * @markdown
  98. * Key codes to ignore so a request is not invoked with bindEvent. The
  99. * "enter" key (13) will always be dynamically added to any list provided
  100. * unless the "cache" option above is set to "true".
  101. *
  102. * ```js
  103. * {
  104. * 9: "tab",
  105. * 16: "shift",
  106. * 17: "ctrl",
  107. * 18: "alt",
  108. * 27: "esc",
  109. * 37: "left",
  110. * 39: "right",
  111. * 38: "up",
  112. * 40: "down",
  113. * 91: "meta"
  114. * }
  115. * ```
  116. */
  117. ignoredKeys: {
  118. 9: "tab",
  119. 16: "shift",
  120. 17: "ctrl",
  121. 18: "alt",
  122. 27: "esc",
  123. 37: "left",
  124. 39: "right",
  125. 38: "up",
  126. 40: "down",
  127. 91: "meta"
  128. },
  129.  
  130. /**
  131. * @member $.fn.ajaxSelectPicker.defaults
  132. * @cfg {String} langCode = null
  133. * @markdown
  134. * The language code to use for string translation. By default this value
  135. * is determined by the browser, however it is not entirely reliable. If
  136. * you encounter inconsistencies, you may need to manually set this option.
  137. */
  138. langCode: null,
  139.  
  140. /**
  141. * @member $.fn.ajaxSelectPicker.defaults
  142. * @cfg {Object} locale = null
  143. * @markdown
  144. * Provide specific overrides for {@link $.fn.ajaxSelectPicker.locale locale string} translations. Values
  145. * set here will cause the plugin to completely ignore defined locale string
  146. * translations provided by the set language code. This is useful when
  147. * needing to change a single value or when being used in a system that
  148. * provides its own translations, like a CMS.
  149. *
  150. * ```js
  151. * locale: {
  152. * searchPlaceholder: Drupal.t('Find...')
  153. * }
  154. * ```
  155. */
  156. locale: null,
  157.  
  158. /**
  159. * @member $.fn.ajaxSelectPicker.defaults
  160. * @cfg {String|Number|Number} log = 'error'
  161. * @markdown
  162. * Determines the amount of logging that is displayed:
  163. *
  164. * - __0, false:__ Display no information from the plugin.
  165. * - __1, 'error':__ Fatal errors that prevent the plugin from working.
  166. * - __2, 'warn':__ Warnings that may impact the display of request data, but does not prevent the plugin from functioning.
  167. * - __3, 'info':__ Provides additional information, generally regarding the from request data and callbacks.
  168. * - __4, true, 'debug':__ Display all possible information. This will likely be highly verbose and is only recommended for development purposes or tracing an error with a request.
  169. */
  170. log: 'error',
  171.  
  172. /**
  173. * @member $.fn.ajaxSelectPicker.defaults
  174. * @cfg {Boolean} mixWithCurrents
  175. * @deprecated Since version `1.2.0`, see: {@link $.fn.ajaxSelectPicker.defaults#preserveSelected}.
  176. */
  177.  
  178. /**
  179. * @member $.fn.ajaxSelectPicker.defaults
  180. * @cfg placeHolderOption
  181. * @deprecated Since version `1.2.0`, see: {@link $.fn.ajaxSelectPicker.locale#emptyTitle}.
  182. */
  183.  
  184. /**
  185. * @member $.fn.ajaxSelectPicker.defaults
  186. * @cfg {Function|null} preprocessData = function(){}
  187. * @markdown
  188. * Process the raw data returned from a request.
  189. *
  190. * The following arguments are passed to this callback:
  191. *
  192. * - __data__ - `Array` The raw data returned from the request, passed by reference.
  193. *
  194. * This callback must return one of the following:
  195. *
  196. * - `Array` - A new array of items. This will replace the passed data.
  197. * - `undefined|null|false` - Stops the callback and will use whatever modifications have been made to data.
  198. *
  199. * ```js
  200. * function (data) {
  201. * var new = [], old = [], other = [];
  202. * for (var i = 0; i < data.length; i++) {
  203. * // Add items flagged as "new" to the correct array.
  204. * if (data[i].new) {
  205. * new.push(data[i]);
  206. * }
  207. * // Add items flagged as "old" to the correct array.
  208. * else if (data[i].old) {
  209. * old.push(data[i]);
  210. * }
  211. * // Something out of the ordinary happened, put these last.
  212. * else {
  213. * other.push(data[i]);
  214. * }
  215. * }
  216. * // Sort the data according to the order of these arrays.
  217. * return [].concat(new, old, other).
  218. * }
  219. * ```
  220. */
  221. preprocessData: function () { },
  222.  
  223. /**
  224. * @member $.fn.ajaxSelectPicker.defaults
  225. * @cfg {Boolean} preserveSelected = true
  226. * @markdown
  227. * Preserve selected items(s) between requests. When enabled, they will be
  228. * placed in an `<optgroup>` with the label `Currently Selected`. Disable
  229. * this option if you send your currently selected items along with your
  230. * request and let the server handle this responsibility.
  231. */
  232. preserveSelected: true,
  233.  
  234. /**
  235. * @member $.fn.ajaxSelectPicker.defaults
  236. * @cfg {String} preserveSelectedPosition = 'after'
  237. * @markdown
  238. * Place the currently selected options `'before'` or `'after'` the options
  239. * returned from the request.
  240. */
  241. preserveSelectedPosition: 'after',
  242.  
  243. /**
  244. * @member $.fn.ajaxSelectPicker.defaults
  245. * @cfg {Function|null} processData = function(){}
  246. * @markdown
  247. * Process the data returned after this plugin, but before the list is built.
  248. */
  249. processData: function () { },
  250.  
  251. /**
  252. * @member $.fn.ajaxSelectPicker.defaults
  253. * @cfg {Number} requestDelay = 300
  254. * @markdown
  255. * The amount of time, in milliseconds, that must pass before a request
  256. * is initiated. Each time the {@link $.fn.ajaxSelectPicker.defaults#bindEvent bindEvent} is fired, it will cancel the
  257. * current delayed request and start a new one.
  258. */
  259. requestDelay: 300,
  260.  
  261. /**
  262. * @member $.fn.ajaxSelectPicker.defaults
  263. * @cfg {Boolean} restoreOnError = false
  264. * @markdown
  265. * Restores the select list with the previous results when the request
  266. * returns with an error.
  267. */
  268. restoreOnError: false,
  269.  
  270. /**
  271. * @member $.fn.ajaxSelectPicker.defaults
  272. * @cfg {Object} templates
  273. * @markdown
  274. * The DOM templates used in this plugin.
  275. *
  276. * ```js
  277. * templates: {
  278. * // The placeholder for status updates pertaining to the list and request.
  279. * status: '<div class="status"></div>',
  280. * }
  281. * ```
  282. */
  283. templates: {
  284. status: '<div class="status"></div>'
  285. }

更新日志:

v1.14.0测试版3(2022-04-21)

  • 错误修正
  • 添加土耳其语
  • 支持将布尔型more参数作为附加参数传递给source.data/source.search回调函数

v1.14.0beta (2021-03-26)

  • 支持Bootstrap程序5
  • 使用vanilla JS选择器获取第一个选项(性能)
  • 修复allowClear,使其触发更改事件
  • 下载测试版。

v1.13.18 (2020-06-27)

  • 已修复Bug

v1.13.17 (2020-05-08)

  • 已修复Bug

v1.13.16 (2020-04-25)

  • 已修复Bug

v1.13.15 (2020-04-21)

  • 已修复Bug

v1.13.14 (2020-04-18)

  • 已修复:TypeError:无法读取未定义的属性“content”
  • 固定:如果选择设置了标题属性(并且不是多选),则选择选项不会更新按钮中的值
  • 改进捷克语翻译
  • 改进JP翻译
  • 添加塞尔维亚语翻译
  • 添加泰语翻译

v1.13.13 (2020-04-17)

  • 已修复:数据大小=“false”不起作用
  • 修复:页面加载后立即调用deselectAll/selectAll引发错误
  • 已修复:搜索时下拉列表变为下拉列表
  • 已修复:键盘对Bootstrap下拉组件的控制停止工作
  • 已修复:在1.13.10中,不再在“默认”值上设置bs类占位符

v1.13.12 (2019-10-11)

  • 修复了错误。
  • 已将liveSearch输入类型从“文本”更改为“搜索”

v1.13.11 (2019-09-20)

  • 已修复:在v1.13.10中选择不存在的选项会引发错误
  • 已修复:调整窗口大小后,下拉菜单的所需宽度中断
  • 已修复:Bootstrap程序选择抛出jquery slim的javascript错误
  • 已修复:optgroup中的多个tick,数据最大选项定义为“1”
  • 修正:在IE11中,如果select有optgroup,则通过“向上”箭头键向下移动时选项不可见

v1.13.10 (2019-04-20)

  • 已修复:搜索时键盘导航不起作用,virtualScroll为false
  • 已修复:自Bootstrap4.1.3以来,具有.form控制类的元素无法正确调整高度
  • 已修复:showTick选项未按预期工作
  • 修正:屏幕阅读器无法读取扩展列表中的元素(NVDA和JAWS)
  • 修正:如果在选项组内,带有选定选项的标准选择不会滚动到选定选项
  • 已修复:hideDisabled和selectedTextFormat:count在选择禁用选项时无法正常工作
  • 已修复:如果在下拉菜单打开时调用.selectricker('val',x),则所选选项样式不会更新
  • 已修复:当菜单打开时禁用virtualScroll时,菜单大小不会更新

v1.13.9 (2019-03-30)

  • 已修复:当virtualScroll被禁用并选择select底部的选项时,所选类无法正确删除
  • 已修复:设置BootstrapVersion选项仍然显示控制台警告
  • 已修复:设置显示刻度类不起作用
  • 修复:每次“刷新”都会附加一个新的span.check-mark
  • 已修复:服务器端错误:未定义HTMLSelectElement
  • 固定:位置Bootstrap选择在输入字段后面
  • 已修复:无法访问移动原生菜单
  • 已修复:在JS生成的select上使用bootstrap select时会引发JS错误(在调用destroy()之后)
  • 已修复:设置styleBase和空样式导致异常
  • 修正了:val()方法触发changed.bs.select,但select的previousValue没有通过
  • 已修复:使用BootstrapVersion时未设置某些默认的Bootstrap 4样式
  • 固定:宽度:适合IE折叠按钮与文本溢出

v1.13.8 (2019-03-16)

  • 已修复:无法使用Bootstrap程序中的内联表单
  • 修正了:使用额外的css计算菜单的高度不正确的问题
  • 已修复:在没有虚拟滚动和一个选项的情况下进行大型单选时出现Sanitizer错误

v1.13.7 (2019-03-13)

  • 已修复:val()方法错误地触发本机更改事件
  • 修正:选择的高度不能通过多行选项自动调整大小
  • 已修复:如果使用较旧的doctype,按钮高度错误
  • 修复了bower_components/bootstrap select/dist中缺少js文件夹的问题
  • 已修复:样式选项不能再包含多个样式
  • 已修复:自动宽度(数据宽度=“auto”)不工作
  • 已修复:通过键入选择选项无法正常工作

v1.13.6 (2019-03-10)

  • 错误修复程序

v1.13.5(2018年12月12日)

  • 错误修复程序

v1.13.4(2018年12月12日)

  • 错误修复程序
  • 改进/扩展liveSearchNormalize
  • 将JSHint替换为ESLint(清理代码)
  • 阿姆哈拉语地区
  • 拉脱维亚语言环境

v1.13.3(2018年10月26日)

  • 错误修复程序
  • 确定下拉框AlignRight“auto”时使用sizeInfo.totalMenuWidth
  • 命名空间窗口事件侦听器,并在调用destroy时移除

v1.13.2 (2018-09-16)

  • 添加选项以手动指定Bootstrap程序的版本
  • 添加对v4.1.0中添加的Bootstrap下拉菜单显示属性的支持
  • 添加$.fn.dropdown.Constructor的检查
  • 提高createDropdown中模板的可读性
  • 如果设置了移动选项,则不要使用聚焦按钮。当选择被聚焦时,使用同级选择器将焦点样式添加到按钮

v1.13.1(2018年8月25日)

  • 已修复:在1.13.0中,潜台词中的HTML内容被转义
  • 已修复:检索Bootstrap程序版本时出错
  • 修正:Bower描述太长
  • 已修复:noneSelectedText不工作
  • 使用innerHTML设置optgroup标签
  • 如果选项被禁用,则不通过changeAll更改选项的选定状态
  • 添加选项以手动指定Bootstrap程序的版本
  • 固定Bootstrap 4中的分隔器
  • 计算liHeight时使用第一个选项的类

v1.13.0(2018年4月19日)

  • 错误修复程序
  • changed.bs.select现在通过previousValue作为第三个参数(而不是选项的前一个值,这是多余的)。这是更改之前选择的值。
  • 支持Bootstrap 4框架。

2018-04-14

  • 允许搜索包含数据内容的选项

2018-03-13

  • 修复数据宽度=“适合”

2018-03-09

  • 当选择1个选项并且selectedTextFormat为计数时,显示所选选项。

2018-03-07

  • v2.2.5:修剪所选选项周围的空白

2018-01-11

  • v2.2.5版本

2017-02-21

  • JS更新

2015-11-28

  • 插件初始化优化

2015-11-24

  • 更多配置。

 

预览截图