• Resolved roachedezigne

    (@roachedezigne)


    On my customers website ( I am a developer), we have built a map with a bunch of points and times…where the data for those points gets pulled from an excel file. I want my customer to be able to login to the backend and edit those points so they dont have to download the excel, edit and re-upload every time. Something like an excel app directly in WordPress. Currently I am pulling the data from the excel file using this javascript code:

    $.ajax({
    type: “GET”,
    url: “http://www.domain.com/wp-content/uploads/2016/09/file.csv”,
    dataType: “text”,
    success: function(data) {

    Is it possible to call a table in TablePress the same way? Is it saved as an excel file somewhere that I can access it or is it accessible by an ajax call like this in another way?

    Please advise! Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    I see what you mean, but unfortunately, something like this is not directly possible. TablePress tables are stored as JSON in the database, and as such, they are not directly accessible via a URL.

    I see two possibilities here: You could either embed the table into a (secret) page on your site, using the Shortcode, and then grab the HTML code of the table from there. However, that will probably require more parsing on the JavaScript side.
    The other idea would be to use the TablePress Extension from https://tablepress.org/downloads/extensions/tablepress-auto-export-tables.zip
    After installing and activating that as a WordPress plugin, each table will automatically be saved to a CSV file in the wp-content/tables folder of your site. With that, you’d have a URL to as CSV file that you can use in your AJAX call.

    Regards,
    Tobias

Viewing 1 replies (of 1 total)

The topic ‘pulling data from table via ajax’ is closed to new replies.