⚠ 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

Best practice for 1_n relationship and multiple inserts in subtable



Nicholas
  • profile picture
  • Member

Posted 06 February 2013 - 21:43 PM

I have a project where there is a large number of 1_n relationships off of different fields from a core table.   I am looking for a best practice to insert multiple records into the related table from the core table's edit form.

 

To oversimplify, lets consider a User table where there can be any number of phone numbers for the user.   Each phone number is a simple text field, so the phone_number table is just [id, user_id, phone_number].  Obviously we don't know the phone numbers beforehand, so a drop down of existing values does not handle this situation.

 

What is the best practice for a user interface in adding these phone numbers through the grocery crud form?  The best solution I can come up with is to pop up a fancybox, then refresh on close.  This is unwieldly however, as in my project there will be multiple fields such as this, and there could be many entries in each field.

 

Perhaps I should step out of grocery crud and roll my own, but the deadline is short, as usual :).   Any ideas for a clean, easy to use (from an end user perspective) system?

 


davidoster
  • profile picture
  • Member

Posted 07 February 2013 - 06:16 AM

Check this out!

You can get ideas from or even borrow [member='goFrendiAsgard']'s code!

I'm sure he won't mind!  ;)


Nicholas
  • profile picture
  • Member

Posted 07 February 2013 - 17:00 PM

Thanks for the idea, his blog currently is not functional/his links go nowhere.  I'll try to contact him directly.    In the meantime, any other ideas for solving this issue within grocerycrud?


davidoster
  • profile picture
  • Member

Posted 07 February 2013 - 19:24 PM

http://getnocms.blogspot.com