select2搜索框查询加遍历
<div class="form-group">
<label class="control-label col-sm-1 no-padding-right" for="entId">公司名称</label>
<div class="col-sm-10">
<div class="clearfix">
<select class="js-example-basic-single js-states form-control" name="entId" id="entId" style="width:100%">
<option value="" _level="-1">--请选择--</option>
<c:forEach items="${hjPztEntInfoList}" var="item">
<option value="${item.value}">${item.name}</option>
</c:forEach>
</select>
</div>
</div>
</div> 注意:jquery要在select2的上面
<!-- JQuery script -->
<!-- 非IE浏览器不会识别IE的条件注释,所以这里判断非IE需要如下写法:参照下面jquery-2.1.4.min.js引入的方式 -->
<!--[if !IE]><!-->
<script type="text/javascript" src="${ctx}/resources/js/plugins/jquery/jquery-2.1.4.min.js"></script>
<!--<![endif]-->
<!--[if IE]>
<script type="text/javascript" src="${ctx}/resources/js/plugins/jquery/jquery-1.11.3.min.js"></script>
<![endif]-->
<script type="text/javascript" src="${ctx}/resources/js/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/plugins/select2/zh-CN.js"></script>
<script src="${ctx}/resources/js/pzt/base/hjPztTalentInfo_Detail.js"></script>
这里只有搜索框
$(function(){
$("#entId").select2({
templateSelection : function(selection) {
return $.trim(selection.text);
}
});
validateTalentInfoForm();
})
这里是有加小图标的
$(function(){
$("#entId").select2({
//templateResult : formatState,
templateSelection : function(selection) {
return $.trim(selection.text);
}
});
validateTalentInfoForm();
})
function formatState(state) {
var $state = $('<span><i class="fa fa-file-text-o green"></i> ' + state.text + '</span>');
return $state;
}
select2搜索框查询加遍历的更多相关文章
- C# 动态生成word文档 [C#学习笔记3]关于Main(string[ ] args)中args命令行参数 实现DataTables搜索框查询结果高亮显示 二维码神器QRCoder Asp.net MVC 中 CodeFirst 开发模式实例
C# 动态生成word文档 本文以一个简单的小例子,简述利用C#语言开发word表格相关的知识,仅供学习分享使用,如有不足之处,还请指正. 在工程中引用word的动态库 在项目中,点击项目名称右键-- ...
- 实现DataTables搜索框查询结果高亮显示
DataTables是封装好的HTML表格插件,丰富了HTML表格的样式,提供了即时搜索.分页等多种表格高级功能.用户可以编写很少的代码(甚至只是使用官方的示例代码),做出一个漂亮的表格以展示数据.关 ...
- python selenium 时间搜索框查询和日期大小比较
在做selenium自动化的时候遇到 时间搜索框查询(如下图)并比较查询结果是否在输入的时间之类. 首先,第一步要做的就是选择时间,并获取到所选时间的文本信息 如上图所示,获取到的时间搜索框并没有文本 ...
- Bootstrap3 模态框 select2搜索框无法输入
<div class="modal fade" role="dialog" aria-hidden="true" data-backd ...
- 在BootStrap的modal中使用Select2搜索框无法输入
用modal来show一个对话框 dialog.modal({ backdrop:true, keyboard:true, show:true }); 1 2 3 4 5 然后再modal中初始化se ...
- angular实现输入框输入添加 搜索框查询
!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"&g ...
- Bootstrap 模态框 select2搜索框无法输入
去掉模态框的div中的 tabindex="-1" 这个属性 <div class="modal fade" role="dialog" ...
- yii2 shi用modal弹窗 select2搜索框无法使用
在modal使用begin的时候指定options选项的tabindex为false Modal::begin([ // ...... 'options' => [ 'tabindex' =&g ...
- 淘宝购物车页面 智能搜索框Ajax异步加载数据
如果有朋友对本篇文章的一些知识点不了解的话,可以先阅读此篇文章.在这篇文章中,我大概介绍了一下构建淘宝购物车页面需要的基础知识. 这篇文章主要探讨的是智能搜索框Ajax异步加载数据.jQuery的社区 ...
随机推荐
- 【POJ 1112】Team Them Up!(二分图染色+DP)
Description Your task is to divide a number of persons into two teams, in such a way, that: everyone ...
- Kudu 实时的存储系统
- Java多线程与并发库高级应用-传统定时器技术回顾
传统定时器技术回顾(jdk1.5以前) public class TraditionalTimerTest { static int count = 0; public static void mai ...
- ActiveMQ发消息和收消息
来自:http://blog.163.com/chengwei_1104/blog/static/53645274201382315625329/ ActiveMQ 是Apache出品,最流行的,能力 ...
- js保留位和取整
//hold是保留位,例,元,角,分 //integerType是在保留位的基础上,如果后面有值,向上向下取整 calAmount:function(hold,integerType,amount){ ...
- 找女神要QQ号码
引言 我们组来了个美女程序员,我心里窃喜,哈哈这下机会来了.我在想怎么下手呢?好吧,还是从QQ号码开始,找到女神要到QQ号,哈哈,我真是个天才~~~ 是这样子滴 想法是美好的,现实是残酷的,找女神要Q ...
- PriorityQueue
基本概念 顾名思义,PriorityQueue是优先级队列,它首先实现了队列接口(Queue),与LinkedList类似,它的队列长度也没有限制,与一般队列的区别是,它有优先级的概念,每个元素都有优 ...
- SQLite遇到的关于x64、x86问题
初次使用SQLite遇到了莫名其妙的问题: 未能加载文件或程序集“System.Data.SQLite, Version=1.0.92.0, Culture=neutral, PublicKeyTok ...
- Guava集合-BiMap
在本篇文章中我们将介绍Guava集合中的BiMap这个接口. com.google.common.collect Interface BiMap<K,V> BiMap接口的父接口是Map& ...
- 一次奇怪的T-shirt展示
因为这次的第一也是上次的第一然后顺延下来又正好跟女神并列第二,拿到了一件T-shirt.总之,还是应该继续加油.