How to use Master-Detail paradigm

Hi, I’m starting a development, and I know I will need something that I can’t find in the tutorials or forums.

I will need Master-Detail forma data entry.

The ideal will be that master and detail will be updateable.

But if not, if I can get a datagrid, where the lines could be easily updated ( add, edit, erase), i’ll be almost happy.

So the idea is to start a topic, where all could propose ideas and solutions.

I have the feeling that you can do it with yii !!

Best Regards

Post some more information about your entities. Is this a parent-child relationship (1 to many), (many to many), or something else?

There are a few different ways to implement such a thing. Let me share a few approaches I’ve used.

Dropdown Select (master) with custom view (detail) which is basically an ‘edit’ form.

Gridview with Modal using JuiDialog to display detail

I find that creating and updating parent/child is fairly easy but choosing how to display them is the hard part.

Thanks for your reply.

The relations between entitiyes are , in this time, quite simples.

Is a Header an a Detail.

In header I have a fee definition, for a School grade.

And in the detail, I will have many entries for each header, with data regarding concepts for charges.

So I was thinking in a 2 steps process.

Step 1, create headeer record, using all the crud that yii provides.

Step 2, with a custom button in CGridView, go to go to a form ( view or set of views) that show me:

Header info, Static, the user cannot change that

Detail info, a CGridView, conditioned by the ID of the header

I suppose that for these I will havve to pass the id to the admin action of the detail, e.g.: (/detail/admin?master_id=xxx)

Let me know if you think there is another best practice.

Best Regards

Hola Nicolas, pudiste hacer funcionar un crud con master/detail, yo me encuentro en este problema, ya que estoy comenzando y me serviria de mucho si me puedes comentar como has hecho funcionar y/o me des un tutorial o ejemplo de ellos.

desde ya muchas gracias.