javascriptarraystabulatorfile-import

How do I load a .csv file in Tabulator local to the server


I have a file that is updated hourly in the same directory as the .html; however, I am unable to load this csv file to create the table.

        //define table
        var table = new Tabulator("#example-table", {
            ajaxURL:"table.csv", //ajax URL
            progressiveLoad:"load", //sequentially load all data into the table
        });

This results in a CORS policy rejection, and my understanding of

        table.import("csv", ".csv");

is for the user to load a file local to the user, not loading a file local to the server. Am I missing something? I would expect my use case to be more common, but I cannot find a way to create this table from a known file on the server.


Solution

  • To answer my own question, I could not get this table to work with a .csv file, so I edited my Python script to parse a .json from the existing csv and plugged that into Tabulator. This file worked with no further issues.