https://preview.keenthemes.com/html/metronic/docs/general/datatables/subtable
Can you please supply us with the JS code / changes to the example code above that would allow us to feed the subtable data via API instead of the hardcoded demo data as in that example?
I can't find any examples of this anywhere else, not even on Datatables site, so... pretty much in dark in terms of how to do this.
Thanks.
Hi,
You can refer to this example to use Datatable API. Also you can refer to Child Rows example.
Regards.
Umm, that doesn't help at all... as the example I linked has this populateTemplate() function that populates the subtable and handleActionButton() that triggers that function... your examples don't even remotely relate to any of that.
So as I asked already, can you provide us with an actual FULL code for this example:
https://preview.keenthemes.com/html/metronic/docs/general/datatables/subtable
that uses API data instead of the demo data, and loads each subtable on demand (as in, only pulls specific API data for that subtable, not the whole set for all subtables at once).
Thanks!
Hi,
Noted, however at the moment, we do not have a sub-table code that works with real API. We will consider adding these features in future updates as soon as possible.
Regards.
Hi Serb,
I’ve not used this myself yet but from looking at the example and have a bit of experience with data tables it looks like it just creates a new data table with in the main data table.
To achieve your desired outcome you should look into the data table Ajax option instead of the examples provided data. I’ll have a further look into this after work.
Hope you can get it working!