On Data Change Event
Description
Hi,
In some cases you may want to track table's data when it has been loaded or changed. For that case I want to create new event called onDataChanged.
What do you think about this feature is it necessary or redundant feature ? If you think it is a nice feature I want to implement that new event
Can you provide some use cases? I'm unsure if I need this event because there is already an onLoadSuccess event in server-side pagination. If you use the load method to update the data in client-side pagination, you also know that the data has changed.
Sure, For example you need to make conditional rendering depending on tables data, then you need listen data instantly, to do that i do not want to execute .getData() method all the time.
<script setup>
import { ref, computed } from 'vue'
const templateRepos = ref([])
const isDefaultExists = computed(() =>
templateRepos.value.some(templateRepo => templateRepo.isDefault === true)
)
</script>
<template>
<div>
<datatable
@on-data-changed="data => (templateRepos = data)"
></datatable>
</div>
</template>