1、修改默认查询方法,使其可以根据value查询

this.element.select2({
allowClear: true,
matcher: function (term, text, element) {
return text.toUpperCase().indexOf(term.toUpperCase()) >= 0 || element.val().toUpperCase().indexOf(term.toUpperCase()) >= 0;
}
});

其中,select2插件是通过遍历matcher方法来匹配查询结果的函数,term:文本框中输入内容,text:当前option显示的文本,element:当前option

select2插件用法的更多相关文章

  1. jQuery的下拉选select2插件用法

    1转自:https://www.jb51.net/article/95561.htm 用了这么久的Select2插件,也该写篇文章总结总结.当初感觉Select2不是特别好用,但又找不到比它更好的下拉 ...

  2. 01:jQuery的下拉选select2插件用法

    1.1 select2插件基本使用 1.下载select2插件 1. 下载地址:https://github.com/select2/select2 2.官网地址:https://select2.or ...

  3. select2插件

    引入select2插件<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min. ...

  4. 基于Metronic的Bootstrap开发框架经验总结(3)--下拉列表Select2插件的使用

    在上篇<基于Metronic的Bootstrap开发框架经验总结(2)--列表分页处理和插件JSTree的使用>介绍了数据的分页处理,使用了Bootstrap Paginator插件,另外 ...

  5. Metronic_下拉列表Select2插件的使用

    这个插件是基于Select的扩展插件,能够提供更加丰富的功能和用户体验,它的github官网地址为:https://select2.github.io/,具体的使用案例,可以参考地址:https:// ...

  6. toastr.js插件用法

    toastr.js插件用法 toastr.js是一个基于jQuery的非阻塞通知的JavaScript库.toastr.js可以设定四种通知模式:成功.出错.警告.提示.提示窗口的位置.动画效果等都可 ...

  7. Select2插件的隐藏、设置宽度

    <select id="selPrinvice" class="Select2 select2-hidden-accessible" style=&quo ...

  8. select2插件使用小记2 - 多选联动 - 笔记

    这是select2插件使用的第二篇,可参考第一篇 select2插件使用小记.上一篇主要是关于基本的使用,这篇主要是关于多选,及联动的.侧重点不同. 效果图如下: 遵从W3C标准:结构.样式.行为.以 ...

  9. jquery uploadify文件上传插件用法精析

      jquery uploadify文件上传插件用法精析 CreationTime--2018年8月2日11点12分 Author:Marydon 一.参数说明 1.参数设置 $("#fil ...

随机推荐

  1. 比sort()性能更好的原生js代码实现数组从小到大排序

    nums = [1,2,4,1,34,6,-1,2] for(let i = nums.length - 1; i > 0; i--) { let maxIdx = i; for(let j = ...

  2. 使用JavaScript制作页面效果3

    一. 1.下拉列表:select对象 属性: option[ ]:选项数组 selectedIndex:被选中选项的索引号 length:选项总数 方法: add(option对象,添加位置):增加选 ...

  3. 容器(docker)内运行Nginx

    容器内运行nginx其实很简单,但是一开始还是浪费了我很多时间.这里写下来给大家省点时间. 1.创建nginx文件夹,放置各种配置及日志等. mkdir /docker/nginx docker 文件 ...

  4. The component and implementation of a basic gradient descent in python

    in my impression, the gradient descent is for finding the independent variable that can get the mini ...

  5. 【Python】itchat

    错误:http://bbs.51cto.com/thread-1501477-1.html 解决方法降低certifi版本 >>> import itchat >>> ...

  6. ATS6.2安装部署笔记

    原文:http://www.safecdn.cn/ats/2018/12/ats6-2-install/1046.html 系统版本:CentOS 6.7 1.安装依赖包 yum -y install ...

  7. Spring Security 理解小记

    JWT 框架图如下, 来自博客https://blog.csdn.net/shehun1/article/details/45394405 个人觉得还不错.. 在开发中Spring boot 启用 加 ...

  8. 链表实现python list数据类型

    #1.<--用单链表的数据结构实现列表class error(Exception): def __init__(self,msg): super(error,self).__init__(sel ...

  9. sql语句应用

    laravel5.6框架中用到的sql语句 //排序 $data=DB::table('admin')->select(array('id','name','password'))->or ...

  10. IAR软件的使用

    STM32标准外设库下载 官网下载链接(需要ST账号登陆): http://www.st.com/content/st_com/en/products/embedded-software/mcus-e ...