• Resolved maksimaks

    (@maksimaks)


    Dear Tobias,

    I have to add some functions to your perfect plugin, but I cannot find files where you get JSON data from DB and schow it HTML table.

    I also cannot understand how should I fetch JSON data from the post_content. The JSON format differs a bit from those Ive found in web.
    I have the like:
    [0] Head of the table
    [1] first row

    In other examples that looks loke that:
    { “id”: “5002”, “type”: “Glazed” },
    { “id”: “5006”, “type”: “Chocolate with Sprinkles” },
    { “id”: “5004”, “type”: “Maple” }

    Like near the each value there is its “column name”…
    Is that possible to convert JSON to the second format to be able to work with that as with an array of objects?

    Otherwise how can I fetch certain values from the cell post_content, like column name, id from JSON array table within SQL (and php or js) ?

    Or is it better to export content into the json file and work with it?

    Im very sorry for the long question.

    Thank you very much in advance.

    BR Maks

    • This topic was modified 8 years, 4 months ago by maksimaks.
Viewing 1 replies (of 1 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    This is not directly possible like that. TablePress doesn’t use an object structure in the JSON, but an array structure, which is more efficient here.
    It loads the data from the database in the controller-frontend.php file, which calls methods from model-table.php.
    The rendering is done in class-render.php.

    Regards,
    Tobias

Viewing 1 replies (of 1 total)

The topic ‘JSON from Datatables DB in HTML’ is closed to new replies.