Okay
  Public Ticket #1647522
Wpdatatables
Closed

Comments

  • Max started the conversation

    Hi,

    Is it possible to use wpdatatables in a dynamic way.... I am wanting to create a dashboard of charts that sits over the top of a custom post type that would hold data relevant to a specific account without having to create a page for each account and building each chart. Ideally having a template that when a user logs in to the site and visits the dashboard they see their data??

    I hope i have been clear enough in my question!!

    Thanks

  • [deleted] replied

    Hi Max,
    Thank you for your inquire.

    Plugin is not designed to work that way, and we do not have built in templating functionality. It will require developing solution which would duplicate previously created table with data for every new users, connect that user to that table in database and dynamically populate id in our shortcode based on the user  which is currently logged in.

  • Max replied

    Hi Miljko,

    Thanks for the reply... 

    please clarify, if i build a chart based on a custom post type then added that shortcode into a page that shows a custom post type would the chart populate with the original data, or would it pick up the data for each post in the custom post type as i moved through the posts

    i.e. I have 3 posts in my CPT post 1,2 & 3.

    if i build a chart using post 1 data, if i use the short code on the page for post 2 & 3 will it show post 1's data or would it update to show data from post number 2 & 3...

    alternatively if I build a table for the custom post type would i be able to filter the table dynamically based on post ID so that the charts on the page only show data for that post ID, but have the table hidded so it is not visible on the Page, Only the charts are seen?Thanks,

    Max


  • [deleted] replied

    Hi Max,

    Charts in our plugin are based on the table so only way to modify the data in the charts are by changing data in the table.

    For creating a dynamic tables based on the post id you can use placeholder  %CURRENT_POST_ID% . More information about using placeholders could be found in our - Documentation

    You can use this placeholders in filter as well. You can create table as you described and create a chart based on it and in that chart turn on option "Follow table filtering". After that in the column which contains post id's set mentioned placeholder as filter predefined value. Last thing is to place both table and the chart on the page and hide the table with CSS. This way our plugin will replace placeholder with real post id and filter the table to show the data related to it.


  • Max replied

    Hi,

    So Basically, I can do what i want to do in a round about way....BUT.... i need to find out a way to generate the tables from the post type if the post type is updated...

    the idea being that a customer can add a post to through a form, but once this has been done i would need to manually recreate the table.... Unless there is a way i could do this by using an event that could be triggered on the posting of the form.....


    I'm getting closer.... just need to work out the bit about how the table would update.

    Thanks,
    Max


  • [deleted] replied

    Hi Max,

    Do you plan to redirect your users to the new page or you want to use ajax and update the table without relaod? Please describe me in more details process of creating and updating posts and updating the table