Hi,
thanks for your post, and sorry for the trouble.
Unfortunately, I have bad news here. Something like this is not possible with TablePress, as it’s not a database replacement system. It can only read its own static tables.
For access to the database, I can therefore only suggest a custom PHP/mySQL solution.
Regards,
Tobias
Assuming I can get the data from the database is there some way I can poke it into the cells as PHP is building the page, maybe some function like set($data, $row, $col); ?
Thanks
Hi,
you could use the functions like save() in the model-table.php file, but I still don’t think that this would be a good solution. If you already have the data in the database, it doesn’t make sense to duplicate that.
One idea could be to overwrite the data that would be rendered with that that you get from the database, e.g. by using a filter hook like tablepress_table_render_data in the class-render.php file.
Regards,
Tobias
Hi Tobias,
I like the idea of the filter hook at tablepress_table_render_data, but I suspect I’m still blocked because the table that you build will have the static number of rows. But I don’t know the actual number of rows in the table until I see how many records come back from the query. Before I give up I wanted to check one last time with you to see if you see anyway to add one or more rows to the table as it’s being built.
Thanks,
Steve
Hi,
the number of rows does not matter here. That filter basically passes the current state of the (dummy) table to your PHP function, which simply has to return the new/desired version of the table (in the correct array format). The size does not matter. TablePress will then render/print what your function returned.
Regards,
Tobias