angeliski / vue-tabulator

Vue Tabulator - The best way to use Tabulator in Vue projects
https://vue-tabulator.netlify.com/
MIT License
35 stars 13 forks source link

Create events for Tabulator callbacks #6

Open angeliski opened 5 years ago

angeliski commented 5 years ago

The Tabulator provide many callbacks to use, but in the vue-way is better use (Custom Events)(https://v1.vuejs.org/guide/components.html#Custom-Events) for that. So we need implement a way to emit events in VueTabulator. Each event should have the name of callback and be emit the same parameters. Ex: tableBuilding -> table-building Important: The vue-tabulator not should remove any configuration from the tabulator, if the user pass a callback to tabulator options, that should be fired and the event emited. API Draft:

<template>
<VueTabulator v-model="data" :options="options" @row-selected="persisteRow" />
</template>

<script>
export default {
  methods: {
   persisteRow(row) {
     //do something
   }
  }
};
</script>

Before init any module, please open a issue to reference the progress. Callbacks to implement:

morficus commented 5 years ago

This is a great idea and I would love to help with some of these. I should have some time over the weekend. I'll make sure to open a new issue before I start.

walkingp commented 5 years ago

Yeah, this is very needed. Thanks for your suggestion.

biker2000on commented 5 years ago

Submitted a pull request for row events. Let me know if you are okay with the strategy for creating the events and I will work on the others.

https://github.com/angeliski/vue-tabulator/pull/8

This will also require an additional strategy for merging into the columns options along the array.

Thank.