Get方法的table进行搜索时方法重载
按钮:
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn">
<i class="layui-icon"></i> 搜 索
</button>
js:
table.render({
elem: '#TableId',
url: dinf.url + 'GetTpAnswerHistListPage?CompanyId=' + CompanyId + '&TPType=' + TPType, //Get方法
.......
})
form.on('submit(data-search-btn)', function (data) {
var result = JSON.stringify(data.field);
var model = {};//可进行搜索的内容
model["Content"] = $("#Content").val();
model["AnswerTimes"] = $("#AnswerTimes").val();
model["UserName"] = $("#Name").val();
model["HistStatus"] = $("#HistStatus").val();
//执行搜索重载
table.reload('TableId', {
page: {
curr: 1
}
, where: {
SearchParam: JSON.stringify(model)
}
}, 'data');
return false;
});