I use searching in bootstrapp table by usage standard HTML attributes.
<table id="clients-table" class="table table-striped table-condensed"
data-url="../data.json"
data-side-pagination="server" data-search="true" >
<thead>
I want to reduce server requests. How can I set searching in bootstrap table only after [ENTER] press or skip request for example when I push arrow buttons?
Use this options for Bootstrap-table :
searchOnEnterKey or data-search-on-enter-key
http://bootstrap-table.wenzhixin.net.cn/documentation/
The most common technique to reduce requests is to set delay.
The built in DataTables global search (by default at the top right of every DataTable)will instantly search the table on every keypress when in client-side processing mode and reduce the search call frequency automatically to 400mS when in server-side processing mode. This call frequency (throttling) can be controlled using the searchDelay parameter for both client-side and server-side processing.
Using searchDelay you can reduce the load on the server when using server-side processing by making fewer calls. https://datatables.net/reference/option/searchDelay
fnSetFilteringDelay - enables filtration delay for keeping the browser more responsive while searching for a longer keyword.
This can be particularly useful when working with server-side processing, where you wouldn't typically want an Ajax request to be made with every key press the user makes when searching the table. https://www.datatables.net/plug-ins/api/fnSetFilteringDelay
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With