Okay
  Public Ticket #3334217
Limit editing to own data problem
Closed

Comments

  •   Jose Ignacio started the conversation
  •  1,849
    Miloš replied

    Hi, Jose.

    Sorry for the delay.

    Can i please check out the back-end setup of this table?

    Please provide me a temporary WP-admin (administrator) user for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. 

    We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties. 

    You can write credentials here just check PRIVATE Reply so nobody can see them except us.

    And let me know what is this table ID, please.

    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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

  •   Jose Ignacio replied privately
  •   Miloš replied privately
  •   Jose Ignacio replied privately
  •   Miloš replied privately
  •   Jose Ignacio replied privately
  •  1,849
    Miloš replied


    Hi, Jose.

    You're welcome, i am happy to help.smile.png

    1. In regards to foreign key column limitation,

    Our 2nd level Team checked my text, and they confirmed that is correct,

    as i described - that is a limitation that will happen;

    to summarize - when we activate that "limit for showing rows to only current user ID",

    it will also reflect the foreign key column,  this column will also show only the rows that the current user created;

    so the workaround in that use-case is to use two tables;

    First table as the main source/Manual Table for Admins and/or any other editing role;

    they can edit it in back-end and additionally if needed on their private page;

    while we can make a new SQL Table to just output this data to other front-end users;


    -

    2. In regards to the second question, i see what you mean.

    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 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 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.

    Let me know how it goes, and if you have any questions.smile.png

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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

  •   Jose Ignacio replied privately
  •   Miloš replied privately
  •  1,849
    Miloš replied

    Hi, Jose.

    We have confirmation, our 2nd level advised.

    Basically, the root of this issue is when we select the CONCAT column from the foreign table,

    as the "displayed value" for the Foreign Key Column 'proyecto', while setting it as editable.

    The SQL CONCAT function is joining/merging some values, and this works for pulling to display the "combined value" in the same cell, but it can not work for Editing.

    For example, if we had this line in SQL to make a Custom CONCAT column :

    CONCAT (table1.name," ",table1.lastName) as fullName

    In that case, the table cell would pull "John Doe" , but this is a value that is combined from two different columns from the database.

    So, the foreign key feature is not able to edit this, because it is looking for only one unique value from the database,  thus the error.

    -

    At this moment, you have to options to work around this limitation :

    1. You can either remove the editing of this Column 'proyecto' - then the editing works, just that column won't be editable.

    7953727231.png
    5829278481.png

    2. Or, you can choose a different column for the "display value" of that foreign key,

    which is not made from CONCAT function.

    In my previous example, i have changed the "display value" to the same one as you set as "store value", the ID column - and then also the Editing worked.

    -

    Let me know if that makes sense and if you have any questions.Thanks.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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