Jump to content


Grocery crud hidden field and set relation didnt work together

set_relation field_type

  • Please log in to reply
1 reply to this topic

#1 Prince Hector

Prince Hector

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 27 January 2016 - 06:58 AM

I have a problem with grocery crud hidden field and set relation .

My code is

$crud->set_relation('created_by','users','user_name'); 
$crud->edit_fields('title', 'description', 'created_by');
$crud->change_field_type('created_by', 'hidden', $this->user_id);

Here i want to store user_id as created by in hidden form. But problem is that created_by field is still visible in my view page. when I cut off set_relation then created_by field is hidden.Note that I have another field which is hidden by this change_field_type but only created_by field is not working when i use set_relation

 

What did i wrong  ? plz help me



#2 Paul Savostin

Paul Savostin

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts
  • LocationUkraine

Posted 05 February 2016 - 12:16 AM

So what is your problem? Why u need set created_by like hidden?

If you set field name in set_relation then hidden or invisible will not working!

So tell me your logic and mb i will help u :)







Also tagged with one or more of these keywords: set_relation, field_type

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users