⚠ 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

relation n-n additional field



janesjoplin
  • profile picture
  • Member

Posted 04 January 2014 - 10:17 AM

Hello, I got a question based on films-actors sample.

 

What if one actor could play twice in the one movie? Or 10 times? How can I add an additional field quantity into relations table and make grocery crud take it into consideration? Pic related.

sbXV3JE.png

 


janesjoplin
  • profile picture
  • Member

Posted 04 January 2014 - 11:03 AM

I can offer a solution, but it is a bit complicated.

    1. catch an event on add item and on delete
    2. force to open prompt window to enter quantity value
    3. send an ajax request to server to set up session variable with quantity and actor id
    4. set callback_before_insert and add quantity data to post_array manually

Any thoughts?