feat(VDataTable): Feat/emit sorted and filtered items v data table
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 I did some stupid stuff, i was suppose to PR against dev branch, so did a rebase and created a new PR on dev.
There's a button for that.
@MajesticPotatoe is there something else that I need to consider regarding this?
@MajesticPotatoe So, I think I got the other things you mentioned resolved now :=) If you find something else I will do necessary adjustments :)
ping @MajesticPotatoe :)
@MajesticPotatoe I think it is fixed now :)
Anything else @MajesticPotatoe :)?
ping @MajesticPotatoe :)