Skip to content

fix(filter-control): wire up hideUnusedSelectOptions for hide-unused-select-options#8376

Open
sawirricardo wants to merge 1 commit into
wenzhixin:developfrom
sawirricardo:fix/hide-unused-select-options
Open

fix(filter-control): wire up hideUnusedSelectOptions for hide-unused-select-options#8376
sawirricardo wants to merge 1 commit into
wenzhixin:developfrom
sawirricardo:fix/hide-unused-select-options

Conversation

@sawirricardo

Copy link
Copy Markdown

Description

The hideUnusedSelectOptions function in src/extensions/filter-control/utils.js was defined and exported but never called anywhere, making the data-hide-unused-select-options attribute completely non-functional.

Reported in #7719 — the feature last worked in v1.19.1.

Changes

  • Add filterControlHideUnusedSelectOptions: false to the filter-control default options
  • Call hideUnusedSelectOptions(selectControl, uniqueValues) in initFilterSelectControls when the option is enabled

Example

<table data-toggle="table"
       data-filter-control="true"
       data-filter-control-hide-unused-select-options="true"
       data-url="json/data1.json">
  <thead>
    <tr>
      <th data-field="id" data-filter-control="select">ID</th>
      <th data-field="name" data-filter-control="select">Name</th>
    </tr>
  </thead>
</table>

Fixes #7719

…used-select-options

The hideUnusedSelectOptions function was defined but never called,
making the data-hide-unused-select-options attribute non-functional.

- Add filterControlHideUnusedSelectOptions option to defaults
- Call hideUnusedSelectOptions in initFilterSelectControls when enabled

Fixes wenzhixin#7719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data-hide-unused-select-options="true" Is not working

1 participant