⚠ 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

removing the priority from relation file in an n to n



richb201

richb201
  • profile picture
  • Member

Posted 17 April 2018 - 22:03 PM

I am using the 

     $crud->set_relation_n_n('activities', 'relation', 'standard_activities', 'activity_id', 'id', 'activity','priority',$where_clause);

 

which causes a very nice picklist. My only issue is that when users chose more than one item from the right hand box, I get both items on a single line  like this "x,y" instead of two items x \n y \n. In looking at the relation file I see that when there is more than one item chosen, the priority field gets set to sequential numbers starting at zero.  I was thinking of using 

 

$crud->callback_after_insert(array($this, 'update_after_insert')); and directly changing the the priority fields to be zero in the hope that this will cause each choice to be on it's own line. 

 

Is after the update after insert the right place to do this? Or is there other place or method I should use to get just one choice per line? 


richb201

richb201
  • profile picture
  • Member

Posted 21 April 2018 - 16:41 PM

Never mind. I solved it through "trial and error".