select2-bootstrap美化下拉框
parent
27c0a440d7
commit
07dc3ee287
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,7 @@
|
||||||
$(function() {
|
$(function() {
|
||||||
// select2复选框事件绑定
|
// select2复选框事件绑定
|
||||||
if ($.fn.select2 !== undefined) {
|
if ($.fn.select2 !== undefined) {
|
||||||
|
$.fn.select2.defaults.set( "theme", "bootstrap" );
|
||||||
$("select.form-control:not(.noselect2)").each(function () {
|
$("select.form-control:not(.noselect2)").each(function () {
|
||||||
$(this).select2().on("change", function () {
|
$(this).select2().on("change", function () {
|
||||||
$(this).valid();
|
$(this).valid();
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
<!-- select下拉框插件 -->
|
<!-- select下拉框插件 -->
|
||||||
<div th:fragment="select2-css">
|
<div th:fragment="select2-css">
|
||||||
<link th:href="@{/ajax/libs/select/select2.css}" rel="stylesheet"/>
|
<link th:href="@{/ajax/libs/select/select2.css}" rel="stylesheet"/>
|
||||||
|
<link th:href="@{/ajax/libs/select/select2-bootstrap.css}" rel="stylesheet"/>
|
||||||
</div>
|
</div>
|
||||||
<div th:fragment="select2-js">
|
<div th:fragment="select2-js">
|
||||||
<script th:src="@{/ajax/libs/select/select2.js}"></script>
|
<script th:src="@{/ajax/libs/select/select2.js}"></script>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
<head>
|
<head>
|
||||||
<th:block th:include="include :: select2-css" />
|
|
||||||
<th:block th:include="include :: header('新增用户')" />
|
<th:block th:include="include :: header('新增用户')" />
|
||||||
|
<th:block th:include="include :: select2-css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="form-content">
|
<div class="form-content">
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-xs-2 control-label">岗位:</label>
|
<label class="col-xs-2 control-label">岗位:</label>
|
||||||
<div class="col-xs-4">
|
<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>
|
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
<head>
|
<head>
|
||||||
<th:block th:include="include :: select2-css" />
|
|
||||||
<th:block th:include="include :: header('修改用户')" />
|
<th:block th:include="include :: header('修改用户')" />
|
||||||
|
<th:block th:include="include :: select2-css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="form-content">
|
<div class="form-content">
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label">岗位:</label>
|
<label class="col-sm-4 control-label">岗位:</label>
|
||||||
<div class="col-sm-8">
|
<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>
|
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue