Vue 3 + Keytable

Vue 3 + Keytable

kshindekshinde Posts: 17Questions: 3Answers: 0

Description of problem: I am using vue-datatables-net for my regular table, and I want to incorporate the inline editing to that. Is there any way we can achieve inline editing similar to keytable in Vue 3? Not sure weather keytables are compatible with Vue 3.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    Yes, you can use DataTables' extensions inside the Vue component. Have a look at this section of the Vue 3 component blog post which discusses how to use the extensions and has an example (not KeyTable, but the same applies).

    Allan

  • kshindekshinde Posts: 17Questions: 3Answers: 0

    Thanks for the replay Allan.
    I tried playing around with extensions on a Stackblitz project, I have added keys configuration in table options but somehow it's not getting applied.
    Here is the project.
    https://stackblitz.com/edit/datatables-net-vue3-extensions-fbn4tv?file=src%2FApp.vue

    Can you please point out what's missing out?

  • kshindekshinde Posts: 17Questions: 3Answers: 0

    Ok. Update: I managed to select a particular cell and also added "keys.editOnFocus" as true, but still I am not able to edit the cell contents.

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    I've made a little edit to add ref="table" to the <DataTable> tag: https://stackblitz.com/edit/datatables-net-vue3-extensions-zkfylh?file=src%2FApp.vue .

    That helps address the console error that was occurring, however, it doesn't enable inline editing. For that you would need Editor which your example doesn't have there.

    Allan

  • kshindekshinde Posts: 17Questions: 3Answers: 0

    Oh Ok. Here is my understanding, please confirm if it's correct.
    So to enable the the inline editing, I would need to purchase the editor and then attach the instance to DataTables. There is no other way to edit the table inline. Is that right?

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Answer ✓

    You could probably get a third party library such as xEditable to work if you had the requirement of using open source only software, but yes, Editor is our solution to editing in a DataTable.

    Allan

Sign In or Register to comment.