Load Datatable From JSON File

2 replies · opened Sep 9, 2023

PpurekartingSep 9, 2023

I have a JSON file locally hosted on our server. I can load this data file into a DataTable without CANVAS using standard directions found at https://datatables.net/manual/ajax

You can see that the JSON file loads here https://inv.governmentautosales.com/inventory.html

I was curious if you could provide some pointers on how to structure my html and Javascript so that it will maintain the awesome work you have done with Canvas styling.

What would I change on the default https://canvastemplate.com/component-datatable.html which is provided in the download so that it pulls data from a local JSON file instead of the static HTML based table data?

Thank you.

PpurekartingSep 10, 2023

I got this working. I may be loading some JS unnecessarily twice, but it seems to work.

SSemicolon WebSTAFFSep 11, 2023

Hello,

Glad the issue was resolved. This should work fine. Canvas does not modify the default functionalities of the DataTables in any way and you can use the default ways of loading JSON using AJAX.

Please do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard