Flexible visibility of element on list for each user!

Dear All,
Currently, I am working on a small application for farmer profile control. There is a strange need from user that can be described below:
? There are 10 items for storing user data;
? User A would like only Item 1>5 be available for him while viewing as a list/ exporting as well. But for User B, he only want I tem 2,5,7,9 be available for list viewing (on his logging session).
I am a new user of Fabrikar and currently have now idea on how to make this available. Could you please be so kind guiding me on this issue with thanks?
Thank you very much for your attention and response.
Dang Dinh Ngoc
 
I assume that there are other users that need to see items 1->10, and that the "items" you are referring to are Fabrik Elements and not rows in the list.

There are several potential ways to achieve this.

Possibly the easiest is to create a second & third list / form on the same table specifically for these two users and unpublish the elements that they don't want to see.

All the other methods I can think of require you to start using Joomla User Groups and View Access Levels which is going to be much more complicated.

Alternatively, can you just say to the users that the functionality needs to be the same for everyone and can they please just ignore the elements they are not interested in?
 
Dear Sophist,
Thank you very much for your response. In fact, the application is for many users (in a villages) to update and keep track of their owned profile. They will actually want some details to be visible on their owned.
I know that Fabrik saves element data in #__elements table. I am thinking of creating a list that work with elements table and will allow user to set visibility on/off and then the list shall be rendered on each user setting.
How do you think about this approach? Or your second choice can work this out?
I can not do much with php coding but if there would be some guide, I can learn to do so.
Thank you for your attention and hopefully that you will find some time helping me out.
Yours very faithfully
Dang Dinh Ngoc
 
Fabrik does not save "data" in the #__elements table - it saves the definition of Fabrik elements in that table. Data is saved in new tables.

It would certainly be possible to allow each user to define which fields they see - and with a bit of imagination, it might even be possible to achieve that using standard Fabrik functionality if:

a. You don't mind the fields being sent to the browser and simply hidden from the user; and
b. You don't mind the fields being visible briefly before being hidden.

Suppose you define another table with 10 elements to match the 10 elements you want to hide, and this new table has one row per user, and a 0 or 1 in the matching element to say whether the users wants to see it or not.

In the list, you join this new table with a LEFT join. The group on this new table is set to hidden. And you create On-Load Javascript on the elements of the new table or the old one to hide the elements that the user has chosen not to see.

Its a bit messy, but it seems to me in theory it should work. But perhaps other experienced users could give their view on this idea and / or suggest alternatives.
 
Many thanks to Sophist for your quick response.
You are right on elements table.
I will try using your approach for a test and my bother you for some more time as I have been away from JavaScript for too long.
Ngoc
 
You probably don't need to write any Javascript - the element Javascript options include the ability to test a value and hide a different element without actually writing any code. :)

If you would like to update this thread to let us know how you get on that would be nice.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top