wenzhixin / bootstrap-table-examples

Bootstrap table examples
https://examples.bootstrap-table.com/
MIT License
2.24k stars 1.62k forks source link

Can you give me an example for filterControlContainer #459

Closed dharen008 closed 2 years ago

dharen008 commented 2 years ago

Description

filterControlContainer Attribute: data-filter-control-container

type: Selector

Detail:

Set to e.g. #filter to allow custom input filter in a element with the id filter. Each filter element (input or select) must have the following class bootstrap-table-filter-control- ( must be replaced with the defined Field name).

Default: false

======================== Can you give me an example for filterControlContainer my goal here is to have multiple filter select outside the table and the result will depend on each filter select

Example(s)

https://live.bootstrap-table.com/code/dharen008/12216

UtechtDustin commented 2 years ago

The data-filter-control-container attribute is a selector, which means you have to use e.g. #toolbar. Also added empty value attributes to the Open this select menu option tags, becaufe no empty value attribute is set Open this select menu would be the value (so the table would be filtered by that and would be empty).

Example: https://live.bootstrap-table.com/code/UtechtDustin/12217

Wil this example solve you're problem ?

dharen008 commented 2 years ago

wow! that was fast! thank you so much!

dharen008 commented 2 years ago

much better if you also add that to the list of example. it will help other people as well. thank you again!

smillove commented 2 years ago

这是一封自动回复邮件。已经收到您的来信,我会尽快回复。

dharen008 commented 2 years ago

Hi, another question. form your example https://live.bootstrap-table.com/code/UtechtDustin/12217

if i choose item 1 from the first select dropdown, how can i filter only the exact item 1 because right now it will show even the item 10+

UtechtDustin commented 2 years ago

You have to strict the search with the option filterStrictSearch.

dharen008 commented 2 years ago

already did that but it is still the same https://live.bootstrap-table.com/code/dharen008/12218

UtechtDustin commented 2 years ago

Please check the category in the documentation, it's a column option not a table option.

dharen008 commented 2 years ago

This one right? thats the one i use on my example here https://live.bootstrap-table.com/code/dharen008/12218

and it its still showing other item 1x+

filterStrictSearch Attribute: data-filter-strict-search

type: Boolean

Detail:

Set to true if you want to use the strict search mode.

Default: false

UtechtDustin commented 2 years ago

As i already wrote, its a COLUMN option not a TABLE option. Example: https://live.bootstrap-table.com/code/UtechtDustin/12235 Bildschirmfoto 2022-07-28 um 09 26 30

dharen008 commented 2 years ago

ohhh ok! Thank you!

dharen008 commented 2 years ago

Hi customer service,

Happy Friday! I don't know if this is a bug or can you let me know what is wrong with my code

so all of the things we discus above is already implemented here, but if you look at the toolbar filter container, I've added the data-search-formatter="false" and data-filter-control="select" to filter out the things only the things inside that table.

if you can see it, the select option value is correct it did not include the formatter. but the select option text is still include the formatter. do i need to do something?

Please let me know your thoughts, Thank you!

image

https://live.bootstrap-table.com/code/dharen008/12345

UtechtDustin commented 2 years ago

@dharen008 As the description of the searchFormatter already explains, this option just toggles the search (value) not the Displayed value in a select.

Set true to search(!!) using formatted data.
dharen008 commented 2 years ago

Hi sir @UtechtDustin ,

Thank you for the info, can you give me a live example for this one Set true to search(!!) using formatted data. so i can achieve the format i want. thank you

dharen008 commented 2 years ago

Hi,

Anyone can help me solve this issue, I cant find a solution.

Thank you

dharen008 commented 2 years ago

Hi

Anyone can help me solve this title issue on data search formatter? please read above and give a live example appreciate it thank you

UtechtDustin commented 2 years ago

The filterDataCollector option should help you.

dharen008 commented 2 years ago

GOT IT! thank you for your assist! appreciate it