1、界面div引入
th:fragment="fragmentSegmentBad"
2、后台
return "/add :: fragmentSegmentBad"
示例:
1、界面
<div id="div4" th:fragment="fragmentSegmentBad">
<h4 class="form-header h4">不良数量</h4>
<div class="form-group">
<div class="col-sm-12">
<div class="select-list">
<ul>
<li th:each="iterStat,iterStat1: ${publicProcessBadList}">
<input type='text' th:attr="name='badList['+${iterStat1.index}+'].badName'" th:value='${iterStat.badName}' style="border: hidden;width: 85px;text-align:right;" readonly='readonly'>
<input type="text" th:attr="name='badList['+${iterStat1.index}+'].badNumber'" style="width: 120px" onkeyup="value=value.replace(/[^\d.]/g,'')" th:value="${iterStat.badNumber}"/>
</li>
</ul>
</div>
</div>
</div>
</div>
js:必须要有
$("#div4").load(prefix+"/queryBatchNumberBad?batchNumber="+batchNumber+"&processName="+processName,function (responseTxt, statusTxt, xhr) {
// 回调函数
});
2、后台