Jump to content


removing the priority from relation file in an n to n

set_relation

  • Please log in to reply
1 reply to this topic

#1 richb201

richb201

    Advanced Member

  • Members
  • PipPipPip
  • 57 posts

Posted 17 April 2018 - 10: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? 



#2 richb201

richb201

    Advanced Member

  • Members
  • PipPipPip
  • 57 posts

Posted 21 April 2018 - 04:41 PM

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







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users