select2-bootstrap美化下拉框

master
RuoYi 5 years ago committed by Limy
parent 39ffe0d1d8
commit 3c94411d03

File diff suppressed because one or more lines are too long

@ -5,6 +5,7 @@
$(function() {
// select2复选框事件绑定
if ($.fn.select2 !== undefined) {
$.fn.select2.defaults.set( "theme", "bootstrap" );
$("select.form-control:not(.noselect2)").each(function () {
$(this).select2().on("change", function () {
$(this).valid();

@ -55,6 +55,7 @@
<!-- select下拉框插件 -->
<div th:fragment="select2-css">
<link th:href="@{/ajax/libs/select/select2.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/select/select2-bootstrap.css}" rel="stylesheet"/>
</div>
<div th:fragment="select2-js">
<script th:src="@{/ajax/libs/select/select2.js}"></script>

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: header('新增用户')" />
<th:block th:include="include :: select2-css" />
</head>
<body>
<div class="form-content">
@ -99,7 +99,7 @@
<div class="form-group">
<label class="col-xs-2 control-label">岗位:</label>
<div class="col-xs-4">
<select id="post" class="form-control select2-hidden-accessible" multiple="">
<select id="post" class="form-control select2-multiple" multiple>
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option>
</select>
</div>

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: header('修改用户')" />
<th:block th:include="include :: select2-css" />
</head>
<body>
<div class="form-content">
@ -78,7 +78,7 @@
<div class="form-group">
<label class="col-sm-4 control-label">岗位:</label>
<div class="col-sm-8">
<select id="post" class="form-control select2-hidden-accessible" multiple="">
<select id="post" class="form-control select2-multiple" multiple>
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>
</select>
</div>

Loading…
Cancel
Save