I have a table that is created using a query (with Inner join and left join). I have enabled the settings for editing own data. For some reason, I am getting an error for both a regular user and the admin when trying to update a field/record. This is the error that is displayed "Error! User do not have permission to update data!". What can be the reason for this? Is it possible that the SQL Joins are causing this? I have tried creating a table manually, and the inline editing works on this. I have attached a screenshot of a sample below, tried to edit the stage field and you would see the error on top. Any help would be great. Thank you.
- 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; }
- Now, the user_ID filter is gone from the front-end.
- 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.
- If you need more details about this, don't hesitate to contact us further.
I have a table that is created using a query (with Inner join and left join). I have enabled the settings for editing own data. For some reason, I am getting an error for both a regular user and the admin when trying to update a field/record. This is the error that is displayed "Error! User do not have permission to update data!". What can be the reason for this? Is it possible that the SQL Joins are causing this? I have tried creating a table manually, and the inline editing works on this. I have attached a screenshot of a sample below, tried to edit the stage field and you would see the error on top. Any help would be great. Thank you.
Hi, rafael
Sorry for the delay
-
You are correct. When you are using JOINS with more tables please note that in wpdatatables,
just one table can be editable at the moment and that is the reason why you can't edit fields in table that you made from two tables.
Let me know if you have any questions.
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 | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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
Hello Miloš,
Thanks for your reply! Any suggestions for workarounds about non-editable tables?
Thanks!
Hi, rafael
If you need a workaround to filter data only for currently logged in user,
but for non-editable tables, i can offer this custom workaround.
Here is an example, this one is for a table linked with an Excel table; but you can use the "same methodology" for any non-editable 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.
- Here is how an example table linked to a source file looks before we make any changes, with visible filters above the table.
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.
- (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 :
- Now, the user_ID filter is gone from the front-end.
- 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.
- If you need more details about this, don't hesitate to contact us further.
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 | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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