https://blog.csdn.net/zhouxiaoyujcut/article/details/79355643
BootstrapTable during the course of the conditions encountered while adding their own inquiries, always only query data to meet the requirements of the current page, the page does not meet the current situation so directly displayed empty. It is a problem for a long time, and ultimately to integrate the many blog was resolved, be summarized here under.
1.bootstarpTable conditions integrated query.
(1) change the location of the page is loaded.
<Table ID = "table_list" Data-URL = "$ {CTX!} / ADMIN / orderInfo / List" Data-Query-the params = "queryParams" Data-Query-the params-type = "undefined"> </ Table>
( 2) to obtain the query
function queryParams (params) {
var = {// the TEMP variable name and the name of the controller where the key must have been, here changes, the controller also need to change the same
pageSize: params.pageSize, // page size
pageNumber: params.pageNumber, // page
phoneNos: $ ( "# phoneNos") Val (),.
allocateStartTime: $ ( "# allocateStartTime") Val (),.
allocateEndTime: $ ( "# allocateEndTime") .val (),
callbackStartTime:$("#callbackStartTime").val(),
callbackEndTime:$("#callbackEndTime").val(),
chargeStartTime:$("#chargeStartTime").val(),
chargeEndTime:$("#chargeEndTime").val(),
lastStartTime:$("#lastStartTime").val(),
lastEndTime:$("#lastEndTime").val(),
charged:$("#charged").val(),
callbackStatus:$("#callbackStatus").val(),
lastStatus:$("#lastStatus").val(),
userName:$("#userName").val(),
portId:$ ( "# Portion"). Val ()
operator: $ ( "# operator") Val (),.
districtCode: $ ( "# districtCode") Val (),.
value: $ ( "# value") Val (),.
sortName: params.sortName, // Sort column names
sortOrder: params.sortOrder // qualifying order (desc, asc)
}
return the TEMP;
}
excitation (3) the query event. Here we must note each time a query should display from the first page, and that page should be set to the selected page. We see there are many online solution is written.
Search function () {
$ ( "# table_list") bootstrapTable ( 'Refresh');.
$ ( "# table_list") bootstrapTable. ( 'refreshOptions', {the pageNumber: '. 1'});
}
In fact, so write function is no problem, but the number of the first page will not be selected. If there is not a table in the front and rear refrush refresh refresh parameters, the query can only be used once, the next time will fail. Then the best way is to refresh the page number to jump performed.
Search function () {
$ ( "# table_list") bootstrapTable ( 'Refresh');.
$ ( '# table_list') bootstrapTable ( 'SelectPage',. 1);.
}
Original: https: //blog.csdn.net/zhouxiaoyujcut/article/details/79355643