在使用layui中的搜尋功能時需要用到表格重載,表格重載的格式如下:
table.reload(ID, options, deep)
其中參數 ID 要重載的表格的 id
參數 options 即為各項基礎參數
參數 deep:是否采用深度重載(即參數深度克隆,也就是重載時始終攜帶初始時及上一次重載時的參數),預設 false
table.reload('currentTableId', {
url: '/api/training/page'
,where: {
train_date:train_date
} //設定異步資料接口的額外參數
});
<select id="select" resultType="com.manager.entity.Training">
select * from y_training
<where>
<if test="train_date!=null">
train_date=#{train_date}
</if>
</where>
</select>