Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter control clear after selected in table has data-height config #6978

Open
vuvtdhh opened this issue Sep 18, 2023 · 0 comments
Open

Filter control clear after selected in table has data-height config #6978

vuvtdhh opened this issue Sep 18, 2023 · 0 comments
Labels
Bug Issues which are marked as Bug

Comments

@vuvtdhh
Copy link

vuvtdhh commented Sep 18, 2023

Bootstraptable version(s) affected

1.22.1

Description

Filter control clear after selected in table has data-height config.
Before filter:
image

After filter selected $1 on Item Price column:
image

Example(s)

https://live.bootstrap-table.com/code/vuvtdhh/16207

Possible Solutions

I see line 8248.
image
When this.options.height has value. The expression is true and this.resetHeader(); will be called, table header will re-init with
initFilterSelectControls function and this function didn't give selected item a selected attribute.
I'm not sure what the idea is. Please review this issue.

Update solution
I can't find any line in initFilterSelectControls function that set checked attribute for the select option.
So, I modified line 4488, I get selected value in filterColumnsPartial property and pass it to addOptionToSelectControl function. After change this line, the table select filter will working fine.
File name: bootstrap-table-filter-control.js
Line: 4488
image
After change line 4488, the commented line is the origin.
image

Additional Context

  • Microsoft Edge
  • Google Chrome
@vuvtdhh vuvtdhh added the Bug Issues which are marked as Bug label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues which are marked as Bug
Projects
None yet
Development

No branches or pull requests

1 participant