Skip to content

feat: add event update:filterDropdownVisible and update:filteredValue for Table.Column #3893

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

Merged
merged 1 commit into from
Apr 5, 2021

Conversation

viruscamp
Copy link

Change the rule of translating template style API Table.Column to prop Table.columns. So that events @update:prop-abc and @prop-abc-change can be translated into prop onPropAbcChange in Table.columns, and we can use :prop-abc.sync="abc" in template style API.
Add event update:filterDropdownVisible for Table.Column
Add event update:filteredValue for Table.Column and add prop onFilteredValueChange for Table.columns

This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

What's the background?

  1. Describe the source of requirement.
    Change the rule of translating template style API Table.Column to prop Table.columns.
    So that events @update:prop-abc and @prop-abc-change can be translated into prop onPropAbcChange in Table.columns,
  2. Resolve what problem.
    We can use :prop-abc.sync="abc" in template style API.
  3. Related issue link.

API Realization (Optional if not new feature)

  1. Basic thought of solution and other optional proposal.
  2. List final API realization and usage sample.
<a-table :data="list">
  <a-table-column key="lastName" data-index="lastName" title="Last Name"
    @filter="(value, record) => record.lastName == value"
    :filters="[
      { text: 'Brown', value: 'Brown' },
      { text: 'Green', value: 'Green' },
      { text: 'Black', value: 'Black' },
    ]"
    :default-filtered-value="['Brown', 'Green']"
    :filtered-value.sync="lastNameFilteredValue"
    :filter-dropdown-visible.sync="lastNameFilterDropdownVisible" />
</a-table>
  1. GIF or snapshot should be provided if includes UI/interactive modification.

What's the effect? (Optional if not new feature)

  1. Does this PR affect user? Which part will be affected?
  2. What will say in changelog?
  3. Does this PR contains potential break change or other risk?

Changelog description (Optional if not new feature)

  1. English description
  2. Chinese description (optional)

Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Additional Plan? (Optional if not new feature)

Add more events like update:prop for other props in Table.Column.

If this PR related with other PR or following info. You can type here.

It's same as event filterDropdownVisibleChange, but can be used with prop as ':filterDropdownVisible.sync="filterDropdownVisible"' for short.
It's the base of other props in Table.Column to add event update:prop to use ':prop.sync' shorthand.
Next events for other props will be update:filteredValue and update:sortDirections.
@tangjinzhou tangjinzhou merged commit 3761edd into vueComponent:1.x Apr 5, 2021
@github-actions
Copy link

github-actions bot commented Apr 6, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants