• 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="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>&nbsp;&nbsp;' + state.text + '</span>'); return $state; }

     
  • 相关阅读:
    iOS Provision 要点记录
    (FIFO)有名管道在无亲缘进程间的通信
    uuid Makefile share
    浅谈C语言中的联合体
    消息队列 进程通信
    onvif makefile without share
    共享内存 进程通信
    共享内存(非map) 进程通信
    消息队列 两个进程
    linux 进程通信
  • 原文地址:https://www.cnblogs.com/xuerong/p/5633147.html
Copyright © 2020-2023  润新知