bootstrap-table
bootstrap-table copied to clipboard
[Feature] side pagination = server cause filter-control does not work
Bootstraptable version(s) affected
1.19.1
Description
if set bootstrap-table sidepagination="server", the bootstrap-table-filter-control features will not work.
Example(s)
No response
Possible Solutions
No response
Additional Context
No response
Please provide an Online Example to show your problem, thanks!
this option sends you a filter parameter to the server make sure you are using that in your query, if so please provide an example about your exact issue or provide screenshots about the problem
I have an example for what I think is happening:
https://live.bootstrap-table.com/code/j1v37u2k3y/10446
The expected behavior once we click the load button is that the filterBy
would load the "Item 3" item.
Once you remove the data-side-pagination="server"
attribute and push the button the filter works as expected.
@Nao-30 any status on this issue I think the example provided shows exactly what's happening. If not please help me understand if there is another issue or setting to make it work.
Thanks
@djhvscf right I agree what else needs to be provided? Do we need to setup something else?
Looks like this is already fixed in develop branch. https://live.bootstrap-table.com/code/djhvscf/10686
We need a new release @wenzhixin
If you hit the load button on the development version it does not filter for "Item 3". So I would it is still not fixed right?
I hit the load button and the data is still filtered
@djhvscf The button is defined incorrectly it should be "filter". The code that is not working correctly is this:
$(function() {
$button.click(function () {
$table.bootstrapTable('filterBy', {name:['Item 3']})
})
})
I have fixed the code to replace the "load" with "filter"...
With data-side-pagination="server"
enabled:
https://live.bootstrap-table.com/code/j1v37u2k3y/10695
Just to be clear the filterBy method should filter by that attribute when that button is pressed:
With data-side-pagination="server"
removed:
https://live.bootstrap-table.com/code/j1v37u2k3y/10696
Is there any more status on this? Or timeframe when this might be fixed?
@djhvscf I am curious as well what the status is of this issue. Thanks!
Checking to see if any changes on this issue. @djhvscf
I don't really think, no i'm pretty sure that's for the "filterBy" issue described above, is NOT actually an issue, since it wasn't made for that.
now that i realized, it is not a part of the extensions.
it's one of the methods tho.
and as described in the docs it can be used only on client side, that's why clearly it doesn't work when data-side-pagination="server"
is enabled;
@Nao-30
You're right, this is not a bug.
Currently it works as designed, as you already said it's also documentated.
In the source code in the internal onSearch
method we don't do anything if it is server-sided: https://github.com/wenzhixin/bootstrap-table/blob/develop/src/bootstrap-table.js#L961
But i agree we should improve that function and pass the parameter to the ajax call, which means the server could filter and return the correct data.