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

Select all rows of a paginated table #416

Open
3 of 4 tasks
wvffle opened this issue Jul 15, 2023 · 0 comments
Open
3 of 4 tasks

Select all rows of a paginated table #416

wvffle opened this issue Jul 15, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@wvffle
Copy link

wvffle commented Jul 15, 2023

Is your feature request related to a problem? Please describe.

My issue is kind of similar to #399. My table displays 10 items at a time and when I'm selecting all the rows, only 10 that are shown are being selected.

Describe the solution you'd like

An async function prop that is called when the select all button is clicked. The function would return an array of selected items or any other value that would be passed to v-model.

The 'any other value' meaning I can for example return a predefined const SELECT_ALL = Symbol() value and then handle bulk removal of items with:

const removeBulk = async () => {
  await $fetch('/api/items/bulk', {
    method: 'DELETE',
    body: selected.value === SELECT_ALL
      ? { type: 'all' }
      : { type: 'some', selected: selected.value }
  })
}

Describe alternatives you've considered

A 4th select all state to the table:

  • None selected
  • Some selected
  • All from :rows selected
  • All selected

The checkbox icon may change to something like this when all data are selected:

Additional context

@wvffle wvffle added the enhancement New feature or request label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant