Okay
  Public Ticket #3572669
Is there a way to reflect the chart per user when an assigned role can only edit and create it?
Closed

Comments

  • Research2024 started the conversation

    Is there a way to reflect the chart per user when an assigned role can only edit and create it?

    We get the feature of creating a manual table then allow editing tab for user... the only thing we want is that instead of user inputting their own data, the admin will put a value, send it to a designated chart in wpdatacharts, then the chart will only generate it for certain user only. Not globally...


    Like user one will only see the chart input to their end...

  •  2,572
    Aleksandar replied

    Hello there.

    The only way of achieving this is to enable the "Users see and edit only own data" feature and then enabling the "Follow table filtering" option when creating the chart.

    You would need to place both the chart and the table on the page in order to do this, though. 

    By default, the charts will not follow any filtering from their source table if you just put the chart "on its own" on the page.

    But If you place the source table together with its chart on the same page, and activate " Follow Table filtering"  on the chart Wizard settings,  it is going to follow any filtering/sorting you do on the table.

    Now, depending on if you wish to hide the table and have a filtering for Charts, we can have two workarounds available.

    1. If you wish to hide the entire table along with table filters;

    you can add this CSS to the table's back-end settings/Customize/Custom CSS.

    .wpdt-c .wpDataTables.wpDataTablesWrapper {
    display: none !important;
    }

    This will completely hide the table from the page, but you can still pass the table shortcode with the chart, and you will get the "follow table filtering" effect on this chart.

    2. Or if you wish just to hide the table while leaving the filters with the chart,

    we would first need to disable the following in the table settings:

    "Show X entries" drop-down; "Info Block" from Display tab:

    5739555450.png

    Then, "Enable main search block"  and "show filters in a form above the table" from the Sorting and Filtering tab:

    7822122957.png

    Then, you can add this CSS in the table settings/Customize/Custom CSS:

    .wpdt-c .wpDataTablesWrapper table {
    display: none !important;
    }
    

    That will just leave the chart visible with the filters on the page if you pass both table and chart shortcodes.

    If admins were to edit these tables, their data would be saved (they will replace) over the user's data. A workaround may be to create an admin table where the "Users edit only own data" is disabled, so the admin can add the data and the user ID in that table, and then create a MySQL query-based table that would pull the data from that table, like "SELECT * FROM table1". Then configure that table so "Users edit only own data" is enabled, and create a chart from it.

    I hope that helps.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables