⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

edit field list changes on certain condition



anchal
  • profile picture
  • Member

Posted 25 February 2013 - 05:27 AM

Hi

I am new to grocery crud. 

The scenario is that I have 2 roles, first TeamLead, second Caller. Now when I go to edit page of any user, i want that if its a team lead, then different fields should be there, and when a caller, then different fields.

The last option is to getstate and write the whole code. I need to know is there any other option?

Thanks in advance.


davidoster
  • profile picture
  • Member

Posted 25 February 2013 - 11:17 AM

How do you implement your roles within your application?

I suppose somehow your users login to the system/app, right?

The extension you use(extra library like ion_auth for example) doesn't give you some extra options about 

categorizing your users under different groups?

 

Let's say something like this would solve your question!

And within your controller function you should use the fields function to limit the fields.

Just be careful to autocomplete fields that have the NOT NULL at your database.