Okay
  Public Ticket #3548492
Table with userdata
Closed

Comments

  • Thomas started the conversation

    Hi there,

    In an WP-Installation users can enter data using a form. The datas are saved in one CSV file.

    Is there a way to create a table with wpDataTables and make it visible in the frontend that only shows the entered data of the respective user?

    But this shouldn't be done via a filter, because that would be 50 different filters for 50 users, for example.

    I've already tried this with a test, but the entire table is always displayed at user level. This means: a user can then also see the data of all other users and that is not allowed.

    Is that feasible?

    Kind regards
    Thomas

  •  1,819
    Miloš replied

    Hi Thomas, 

    Sorry for the waiting time.

    We don't work on weekends so it adds two days to the waiting time.

    we appreciate your patience.


    Yes, we have a workaround for non-editable ( linked to a file source) tables, 

    to restrict only showing the rows for the currently logged-in user.

    I will show you an example with an excel source but you can use the same way with csv sources table.


    - First, you would have to add a custom "user_id" column on the source Excel side, which you can hide if needed in our plugin from the front-end. 

    We will add a predefined filter value to it, using a Place Holder "Current User ID";

    - Check that the filter type is set as "Text", as shown on this screenshot.

    8249361981.png

    - Here is how an example table linked to a source file looks before we make any changes, with visible filters above the table.

    7932387639.png

    And now, when we set the pre-filter, with Administrator logged in ( In our case, the user ID is 1), we only see rows matching that user ID.

    3633379684.png

    - (If you need more detailed information about using Place Holders in wpDataTables, here is our documentation about that https://wpdatatables.com/documentation/table-features/using-placeholders/);

    - The user_ID filter is still visible, which means, if someone changes/deletes this value, they could see the whole table.

    We will hide it from the front-end with some custom CSS added in the "Customize" section of the main table settings.

    - It should be easy to do, depending on your knowledge of HTML and CSS.

    You have to find the correct selector using the browser inspector tool, add the style "display:none" property to it, and it will disappear from the front-end.

    On our example table, the custom CSS is :

    #table_1_5_filter_sections  {
        display:none; }
    5537273103.png

    - Now, the user_ID filter is gone from the front-end.

    8120839900.png

    - Optionally, you can hide the user_id column from the front-end, if needed, either using the column settings tab or the "column list" button from the back end Admin area.

    1618300341.png

    - If you need more details about this, don't hesitate to contact us further.


    Kind Regards, 

    Miloš Jovanović
    [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

  • Thomas replied

    Hi Milos,

    Thank You for the help :-)


    Kind regards

    Thomas

  •  1,819
    Miloš replied

    Hi Thomas,

    You're welcome.

    I will cover the rest of your open tickets as quickly as possible, and also please don't hesitate to open other new ones if anything else comes up.

    Thanks.

    Kind Regards, 

    Miloš Jovanović
    [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