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

Event for after filter selects are populated #6072

Open
jonatanschroeder opened this issue Mar 9, 2022 · 4 comments · May be fixed by #6309
Open

Event for after filter selects are populated #6072

jonatanschroeder opened this issue Mar 9, 2022 · 4 comments · May be fixed by #6309
Assignees
Labels
Bug Issues which are marked as Bug confirmed Issues that have been confirmed with a reduced test case and identify a bug. filter-control Issues for the filter-control extension.

Comments

@jonatanschroeder
Copy link

Description

Currently onFilterControls (in the filter control extension) is called when the DOM elements for filters are created. However, for select elements, this is done before option elements are added. This means that the event cannot be used for any operation that requires the value (or options) to be retrieved or updated. It would be great to have an event that is called when the filter control values are populated (or updated).

Related: #6030 (comment). Note that use of onSearch, since onFilterControls would not work for selects since options are not set at that point.

@UtechtDustin
Copy link
Collaborator

Could you please provide us an example using our online editor?

@UtechtDustin UtechtDustin added the needs example Need an example in order to confirm the issue or the PR. label Mar 14, 2022
@jonatanschroeder
Copy link
Author

Sure, here it is:
https://live.bootstrap-table.com/code/jonatanschroeder/10833

Note that the event for filter controls is called when there are no options yet. So the select exists, but isn't yet populated.

@UtechtDustin UtechtDustin added confirmed Issues that have been confirmed with a reduced test case and identify a bug. filter-control Issues for the filter-control extension. Bug Issues which are marked as Bug and removed needs example Need an example in order to confirm the issue or the PR. labels Mar 14, 2022
@UtechtDustin
Copy link
Collaborator

@djhvscf i guess this is a issue for you.
The issue would be fixed if we add that.trigger('created-controls') to https://github.com/wenzhixin/bootstrap-table/blob/develop/src/extensions/filter-control/utils.js#L332-L333.
But the method initFilterSelectControls is called 14 times!!
Do we needed the 14 calls ?

@djhvscf
Copy link
Collaborator

djhvscf commented Mar 17, 2022

@djhvscf i guess this is a issue for you. The issue would be fixed if we add that.trigger('created-controls') to https://github.com/wenzhixin/bootstrap-table/blob/develop/src/extensions/filter-control/utils.js#L332-L333. But the method initFilterSelectControls is called 14 times!! Do we needed the 14 calls ?

I don't think we need 14 calls! Let me check that

@djhvscf djhvscf self-assigned this Mar 17, 2022
@djhvscf djhvscf linked a pull request Aug 3, 2022 that will close this issue
10 tasks
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 confirmed Issues that have been confirmed with a reduced test case and identify a bug. filter-control Issues for the filter-control extension.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants