Hi all!
I have been trying to get the KTDatatable component to work but no joy so far.
I did look through all the documentation I could find on the KTDatatables and the only real documentation I found (https://preview.keenthemes.com/metronic8/vue/docs/#/kt-datatables) does only have boilerplate html en JS code in it and these are the ones I'm using, the one with the loading to be specific.
The loading prop however is working perfectly fine.
I'm able to get the the component on my page en it works perfectly fine if I load static data.
Once I do a call my api and put the :table-data prop to users where users is an array. Containing an empty array at first but it gets updated once the data from the api is returned.
The :table-data gets updated in the component as it should but the const getitems never gets recomputed thus no rows are shown in the datatable.
Is there something I'm missing at my part or am I doing something wrong?
Hi Lukas!
Could you please attach the code of your getItems function?
You need to add a variable to your component which will be passed into a KTDatatable through table-data prop and when you receive data from your API you need to update this variable.
Update variable using splice function as shown in the example below.
variable_passed_to_table.value.splice(0, variable_passed_to_table.value.length, ...variable_passed_to_table.value);
Allright I got the data in the table with the code above!
Thanks!