vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

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

Open joelmandell opened this issue 1 year ago • 13 comments

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>

joelmandell avatar Mar 12 '24 15:03 joelmandell

@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.

joelmandell avatar Mar 18 '24 07:03 joelmandell

There's a button for that.

KaelWD avatar Mar 18 '24 07:03 KaelWD

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

joelmandell avatar Apr 02 '24 13:04 joelmandell

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

joelmandell avatar Apr 03 '24 09:04 joelmandell

ping @MajesticPotatoe :)

joelmandell avatar Apr 30 '24 18:04 joelmandell

@MajesticPotatoe I think it is fixed now :)

joelmandell avatar May 01 '24 20:05 joelmandell

Anything else @MajesticPotatoe :)?

joelmandell avatar May 16 '24 19:05 joelmandell

ping @MajesticPotatoe :)

joelmandell avatar Jul 04 '24 13:07 joelmandell