Thymeleaf--:fragment
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<body>
<div th:fragment="crudmodal"> //主要是这里
<!-- modify modal -->
<div class="modal fade" id="crudmodal_modify" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<body>
<!-- crudmodal -->
<!-- add modal -->
<div th:fragment="crudmodal"> <!-- modify modal -->
<div class="modal fade" id="crudmodal_modify" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div style="width: 900px;" class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
<h4 id="modaltitle" class="modal-title">送检人员</h4>
</div>
<div class="modal-body">
<div class="panel panel-default">
<form class="form-horizontal" style="width: 60%;"> <div class="form-group">
<div class="col-sm-2 control-label">姓名</div>
<div class="col-sm-10">
<input id="xingMing" type="text" class="form-control"
placeholder="姓名" />
</div>
</div>
<div class="form-group">
<div class="col-sm-2 control-label">性别</div>
<div class="col-sm-10">
<select class="col-sm-10 form-control" id="xbSelect"
style="float: left;">
<option value="男">男</option>
<option value="女">女</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2 control-label">身份证号码</div>
<div class="col-sm-10">
<input id="shenFenZhengHaoMa" type="text" class="form-control"
placeholder="身份证号码" />
</div>
</div> <div class="form-group">
<div class="col-sm-2 control-label">电话号码</div>
<div class="col-sm-10">
<input id="dianHuaHaoMa" type="text" class="form-control"
placeholder="电话号码" />
</div>
</div>
<!-- <div class="form-group">
<div class="col-sm-2 control-label">地区</div>
<div class="col-sm-10">
<input id="quYuMingCheng" type="text" class="form-control"
placeholder="地区" />
</div>
</div> -->
<div class="form-group">
<div class="col-sm-2 control-label">区域</div>
<div class="col-sm-10">
<select class="form-control" id="quyuSelect">
<option th:each="quyuguanli:${quyuguanlis}"
th:value="${quyuguanli.id}"
th:text="${quyuguanli.quYuMingCheng}"
th:attr="phone=${quyuguanli.quYuBianMa}"></option>
</select>
</div>
</div>
<!-- <div class="form-group">
<div class="col-sm-2 control-label">人员状态ID</div>
<div class="col-sm-10">
<input id="renYuanZhuangTaiId" type="text"
class="form-control" placeholder="人员状态ID" />
</div>
</div> -->
<div class="form-group">
<div class="col-sm-2 control-label">人员状态</div>
<div class="col-sm-10">
<select class="form-control" id="ryztSelect">
<option th:each="ryztadd:${renyuanzhuangtais}"
th:value="${ryztadd.renYuanZhuangTaiId}"
th:text="${ryztadd.renYuanZhuangTai}"></option>
</select>
</div>
</div>
</form>
</div> </div>
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-dismiss="modal"
modifyid="" AddorModify="" onclick="addorModifySubmit(this);">是</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div> <!-- delete modal -->
<div class="modal fade" id="crudmodal_delete" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
<h4 class="modal-title">作废订单</h4>
</div>
<div class="modal-body">是否确定作废该订单吗?</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">否
</button>
<button type="button" class="btn btn-primary" data-dismiss="modal"
deleteid="0" onclick="delSubmit(this);">是</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div> <!-- operation result modal -->
<div class="modal fade" id="crudmodal_result" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
<h4 class="modal-title">操作结果</h4>
</div>
<div id="crudmodal_result_operateResult" class="modal-body"> </div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"
onclick="refresh();">确定</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div> <!-- loading modal-->
<div class="modal fade" id="crudmodal_loading" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel" data-backdrop='static'>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">提示</h4>
</div>
<div class="modal-body">请稍候。。。</div>
</div>
</div>
</div> </div> </body>
</html>
完整版
function initModifyModal(obj) {
jQuery.ajax({
url: '/sjr/' + $(obj).attr('whatever'),
type: 'GET',
beforeSend: function () {
$('#crudmodal_loading').modal('show'); 弹出对应的界面块
},
error: function (request) {
$('#crudmodal_loading').modal('hide');
$('#crudmodal_result #crudmodal_result_operateResult').html('操作失败');
$('#crudmodal_result').modal('show');
},
success: function (data) {
if (data.code == 200) {
$('#crudmodal_loading').modal('hide');
$('#crudmodal_modify #xbSelect').val(data.data.xingBie);
$('#crudmodal_modify .btn-primary').attr('AddorModify',2); //1是添加 2 修改
$('#crudmodal_modify .btn-primary').html("修改");
$('#crudmodal_modify #modaltitle').html("送检人员-修改");
$('#crudmodal_modify').modal('show');
} else {
$('#crudmodal_loading').modal('hide');
$('#crudmodal_result #crudmodal_result_operateResult').html('操作失败:' + data.code);
$('#crudmodal_result').modal('show');
}
}
});
}
但是网上很多网友的做法不是这样的,
---------以下都看不懂
thymeleaf中fragment 的layout布局 - CSDN博客
http://blog.csdn.net/shanshan_blog/article/details/65630607
=========
<</span>div th:include="common/test:: test2(value1,value2)"></</span>div>
<</span>div th:fragment="test2(valueOne,valueTwo)">
Thymeleaf--:fragment的更多相关文章
- Thymeleaf+Spring整合
前言 这个教程介绍了Thymeleaf与Spring框架的集成,特别是SpringMvc框架. 注意Thymeleaf支持同Spring框架的3.和4.版本的集成,但是这两个版本的支持是封装在thym ...
- spring+thymeleaf实现表单验证数据双向绑定
前言 这个教程介绍了Thymeleaf与Spring框架的集成,特别是SpringMvc框架. 注意Thymeleaf支持同Spring框架的3.和4.版本的集成,但是这两个版本的支持是封装在thym ...
- Thymeleaf模板引擎+Spring整合使用方式的介绍
尊重原创,原文地址为:https://www.cnblogs.com/jiangchao226/p/5937458.html 前言 这个教程介绍了Thymeleaf与Spring框架的集成,特别是Sp ...
- spring-security doc logout
18.5.3 Logging Out Adding CSRF will update the LogoutFilter to only use HTTP POST. This ensures that ...
- thymeleaf之fragment
MUEAS项目,web前端采用thymeleaf作为展示层.这个view解析器,个人觉得非常不错.简单而且性能也比较好!个人觉得比JSP和freemarker之类,简单易用! 今天简单记录一下frag ...
- thymeleaf的fragment例子
fragment介绍 fragment类似于JSP的tag,在html中文件中,可以将多个地方出现的元素块用fragment包起来使用. 定义fragment 新建foot.html文件 <!D ...
- spring boot:thymeleaf给fragment传递参数的方法(spring boot 2.3.3)
一,thymeleaf如何给fragment传递参数? 1,如果是全局的参数,可以用interceptor中传递 非全局参数,可以从controller中传递 2,引用片断时也可以传递参数 说明:刘宏 ...
- spring boot:thymeleaf模板中insert/include/replace三种引用fragment方式的区别(spring boot 2.3.3)
一,thymeleaf模板中insert/include/replace三种引用fragment方式的区别 insert: 把整个fragment(包括fragment的节点tag)插入到当前节点内部 ...
- spring boot(四):thymeleaf使用详解
在上篇文章springboot(二):web综合开发中简单介绍了一下thymeleaf,这篇文章将更加全面详细的介绍thymeleaf的使用.thymeleaf 是新一代的模板引擎,在spring4. ...
- Thymeleaf
1.在html顶部添加 <html xmlns:th="http://www.thymeleaf.org"> 2.url表达式 @{...} <link rel= ...
随机推荐
- redis4.0.6集群搭建
文件环境:CentOS7 + redis4.0.6 先去官网下载redis:https://redis.io/,然后上传到你的虚拟机,我上传到了/mysoft 先解压->然后进入主目录-> ...
- CSS 条件判断、等宽字体以及ch单位
<!DOCTYPE> <html lang="en"> <head> <meta charset="utf-8"> ...
- Elastic Stack之ElasticSearch分布式集群二进制方式部署
Elastic Stack之ElasticSearch分布式集群二进制方式部署 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 想必大家都知道ELK其实就是Elasticsearc ...
- TranslateMessage消息翻译和DispatchMessage消息分发
TranslateMessage函数将虚拟键消息转换成字符消息.比如: 消息WM_KEYDOWN和WM_KEYUP组合产生一个WM_CHAR或WM_DEADCHAR消息. 消息WM_SYSKEYDOW ...
- Dubbo简易控制中心安装
1. zookeeper安装(单机版):http://www.cnblogs.com/wangfajun/p/5251159.html √ 2. dubbo管控台安装(zookeeper单机版):h ...
- golang反射举例
反射就是在运行状态中,对于任意一个类,都能够知道这个类的所有属性和方法:对于任意一个对象,都能够调用它的任意方法和属性:并且能改变它的属性. package main import ( "f ...
- mysql 批处理命令执行多个sql脚本
方法1 若有SQL脚本a.sql, b.sql, 其目录在f盘根目录下, 则可再写一个SQL脚本c.sql(假设其目录也在f盘根目录下, 也可以在其他路径下)如下: source f:/a.sql; ...
- js方法参数中含有单引号双引号的处理
最近在做项目时,遇到一个问题.当在js脚本中,拼接生成一个tr,然后添加到一个表格里. //假定testval是从后台传过来的数据 var testval = "含有'半角单引号的字符串&q ...
- python爬虫慕课基础1
test_urllib2.py import http.cookiejar from urllib import request url = "http://www.baidu.com&qu ...
- Http状态码解释
参考:urllib与urllib2的学习总结(python2.7.X) # Table mapping response codes to messages; entries have the # f ...
转载▼