Open marceloverdijk opened 2 years ago
Maybe this is intended behaviour? and when using a data-custom-search
function it cannot be combined with $('#table').bootstrapTable('filterBy', {}, { 'filterAlgorithm': () => ..do some custom filtering.. })
?
Just to explain what I'm trying to accomplish:
data-search-selector
, so it will automatically filter the table.filterBy
filterAlgorithm
function to further filter on category and/or price.Above works perfectly.
But now I want to change the default keywords search (data-search-selector
) by a more intelligent fuzzy search.
That's why I though just to add a data-custom-search
to override the default search function.
To execute the advanced fuzzy search (using fuse.js) I need to have hold of all data; so only having access to the row is not enough. So with filterBy
only I cannot solve this unfortunately.
What should be the best way to do this?
I found a way to implement this and here is a full example: https://live.bootstrap-table.com/code/marceloverdijk/13510
This might be useful for others or maybe could be used to be included in the example repo?
Bootstraptable version(s) affected
1.21.1
Description
When using
customSearch
andfilterBy
with afilterAlgorithm
function thefilterAlgorithm
function is not called.As soon as a custom search is configured filter by won't work anymore...
In below code the
filtering
andfiltering done
are logged, but neverfiltering row
.The example ref below proves this. When disabling the custom search the
filtering row
is working.Example(s)
https://live.bootstrap-table.com/code/marceloverdijk/13480
Possible Solutions
No response
Additional Context
No response