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

feat(VDataTable): Feat/emit sorted and filtered items v data table #19382

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from

Conversation

joelmandell
Copy link

Description

It exposes events for susbscribing on filtered data when using search-prop and also getting the sorted data when sorting.
Something I need for example to export all visible rows to a pdf and not only the paged result (i.e currentItems).
Seen as requested here as well for example: https://stackoverflow.com/questions/76008941/vuetify-3-data-table-current-items

Markup:

<template>
  <v-data-table :search="searchKey" :items="items" 
   @update:filteredItems="filteredItems" 
   @update:sortedItems="sortedItems"></v-data-table>
</template>

<script setup>
  import {
   ref
  } from 'vue'

  const searchKey = ref(''),
 
  const filteredItems = (items) => {
      console.log(items);
  }

  const sortedItems = (items) => {
      console.log(items);
  }

  const items = [
    {
      name: 'African Elephant',
      species: 'Loxodonta africana',
      diet: 'Herbivore',
      habitat: 'Savanna, Forests',
    },
    {
      name: 'Fantastic',
      species: 'Fab',
      diet: 'Vegan',
      habitat: 'Vuitton',
    },
    // ... more items
  ]
</script>

@MajesticPotatoe MajesticPotatoe added T: feature A new feature C: VDataTable VDatatable labels Mar 14, 2024
Copy link
Member

@MajesticPotatoe MajesticPotatoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebase to dev

@joelmandell
Copy link
Author

@MajesticPotatoe I did some stupid stuff, i was suppose to PR against dev branch, so did a rebase and created a new PR on dev.

@KaelWD KaelWD changed the base branch from master to dev March 18, 2024 07:57
@KaelWD
Copy link
Member

KaelWD commented Mar 18, 2024

There's a button for that.

@joelmandell
Copy link
Author

@MajesticPotatoe is there something else that I need to consider regarding this?

Copy link
Member

@MajesticPotatoe MajesticPotatoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • fix lint errors
  • add api descriptions to api-gen

@joelmandell
Copy link
Author

joelmandell commented Apr 3, 2024

@MajesticPotatoe So, I think I got the other things you mentioned resolved now :=) If you find something else I will do necessary adjustments :)

@joelmandell
Copy link
Author

ping @MajesticPotatoe :)

Copy link
Member

@MajesticPotatoe MajesticPotatoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • resolve merge conflicts

@joelmandell
Copy link
Author

@MajesticPotatoe I think it is fixed now :)

@joelmandell
Copy link
Author

Anything else @MajesticPotatoe :)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDataTable VDatatable T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants