Is it possible to use WPDataTables to keep a gradebook for users on our site?
We'd like to have admins be able to edit the tables for each student but keep the student as view only. How feasible would it be for the admin to go and edit each user's table data?
I followed the tutorial for setting up a manual table with user ID to keep data unique for each user. Now I'm curious if it's really feasible to edit each table for each user from the backend. What would be required to do that?
I am not sure if I understood all the aspects of this Use-Case.
For example, if you wish to have one "main/master" Table which is only for Admins to see all user's data and to be able to edit everything, while having an additional Table as 'view only' for the users on front-end, we will explain a workaround with two tables.
You can achieve this with our premium plugin if you use SQL based tables.
For example, you can have one main/master Manual table which will store all the data in the database.
Then, you can check this table's MySQL Table name from the Editing tab in the back-end table settings,
and you will be able to make multiple SQL tables that pulls data from the same "master table",
and any editing you do on all these other SQL tables are going to be stored in the same table in the database,
This will be my example table :
Now, to make a new SQL Table from it,
first, check in Editing Tab/MySQL table name for editing:
in my example, the Manual table name is wp_wpdatatable_39,
so i make a new SQL table that will pull data from it;
and we can choose all columns like :
SELECT * FROM Table_Name
or just specific columns;
we can also have completely different settings/filtering/sorting and limitations for front-end users on each table;
and you can make multiple SQL Query tables that pull the same data from the "main table".
SELECT column_name1,
column_name2,
column_name3
FROM table_name
-
In this example, if i want to limit to only show the "Company" column, and i will leave wdt_ID ( because we got to have row ID) and userid ( if we want userID for limiting rows per currently logged user ID),
when i hide those columns in the end, the front-end user will only see the "company" column.
SELECT wdt_ID,
userid,
company
FROM wp_wpdatatable_39
Later, you can make another SQL Table that will show some other columns, have other filters and so on ( depending on what you need to achieve)...
My apology, I just forgot to add the last 'piece of the puzzle' since you also need each user to only see their own rows in the end, right?
The 'core setup' with the main Manual Table for Admins, and another SQL Table for the front-end users will stay the same, we will just add that 'limit the rows for each user by user ID' solution in the end.
So on the main Admin's Manual table, we will not set any 'restrictions';
but for the additional SQL Query table, you can activate the feature 'Users see and edit only own data' under the Editing, but set the "Editor roles" to only Administrator Role.
With a setup like this, the Admins will be able to edit the actual "userid" Column on their 'master Table' to set which user is going to see which rows by ID;
and in the additional SQL Query table, you can set the Editor Role only for Admins - so it will become 'view only' for the front-end users.
And of course, you will hide the 'user id' column from that SQL Table, so you can only show the columns they need to see, the rows they need to see, and there are many more possibilities to limit what they can see with filters and so on...
Let me know if that achieves the use-case, when you combine the details from both replies?
Thanks so much, Miloš! This is super helpful and should do what we need it to do. I think it will be a useful example for others with similar use cases.
Is it possible to use WPDataTables to keep a gradebook for users on our site?
We'd like to have admins be able to edit the tables for each student but keep the student as view only. How feasible would it be for the admin to go and edit each user's table data?
I followed the tutorial for setting up a manual table with user ID to keep data unique for each user. Now I'm curious if it's really feasible to edit each table for each user from the backend. What would be required to do that?
Thanks
Hi Philip,
I am not sure if I understood all the aspects of this Use-Case.
For example, if you wish to have one "main/master" Table which is only for Admins to see all user's data and to be able to edit everything, while having an additional Table as 'view only' for the users on front-end, we will explain a workaround with two tables.
You can achieve this with our premium plugin if you use SQL based tables.
For example, you can have one main/master Manual table which will store all the data in the database.
Then, you can check this table's MySQL Table name from the Editing tab in the back-end table settings,
and you will be able to make multiple SQL tables that pulls data from the same "master table",
and any editing you do on all these other SQL tables are going to be stored in the same table in the database,
This will be my example table :
Now, to make a new SQL Table from it,
first, check in Editing Tab/MySQL table name for editing:
in my example, the Manual table name is wp_wpdatatable_39,
so i make a new SQL table that will pull data from it;
and we can choose all columns like :
or just specific columns;
we can also have completely different settings/filtering/sorting and limitations for front-end users on each table;
and you can make multiple SQL Query tables that pull the same data from the "main table".
-
In this example, if i want to limit to only show the "Company" column, and i will leave wdt_ID ( because we got to have row ID) and userid ( if we want userID for limiting rows per currently logged user ID),
when i hide those columns in the end, the front-end user will only see the "company" column.
Later, you can make another SQL Table that will show some other columns, have other filters and so on ( depending on what you need to achieve)...
You can see my Video example here https://watch.screencastify.com/v/jOXrsJ9jaspWG5m3VqZH
Let me know if that makes sense and 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
Hi Philip,
My apology, I just forgot to add the last 'piece of the puzzle' since you also need each user to only see their own rows in the end, right?
The 'core setup' with the main Manual Table for Admins, and another SQL Table for the front-end users will stay the same, we will just add that 'limit the rows for each user by user ID' solution in the end.
So on the main Admin's Manual table, we will not set any 'restrictions';
but for the additional SQL Query table, you can activate the feature 'Users see and edit only own data' under the Editing, but set the "Editor roles" to only Administrator Role.
With a setup like this, the Admins will be able to edit the actual "userid" Column on their 'master Table' to set which user is going to see which rows by ID;
and in the additional SQL Query table, you can set the Editor Role only for Admins - so it will become 'view only' for the front-end users.
And of course, you will hide the 'user id' column from that SQL Table, so you can only show the columns they need to see, the rows they need to see, and there are many more possibilities to limit what they can see with filters and so on...
Let me know if that achieves the use-case, when you combine the details from both replies?
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 | 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
Thanks so much, Miloš! This is super helpful and should do what we need it to do. I think it will be a useful example for others with similar use cases.