0
votes

I have three tables in my database. They are Student, Subject and Mark. Student has these fields: id, name, address. Subject has these fields: id, name. And Mark has these fields id, studentId, subjectId and mark. So, here I have these associations like Student can have many subject and one subject has one mark. So, how can I define these relations in MVC pattern like placing them in Model and Store. I want to display the information like student_name, student_address, subject_name and marks in my grid panel. But I having trouble associating them in Model and Stores.

2
Their are lots of examples out there. What did you come up with yourself? - Tarabass
I got no clue so I just went on defining separate model and store for my required data and passing those data from the backend - user3127109

2 Answers

0
votes

Take a look at the docs of the model and the reader. There you will find enough information to get you started.

After reading the docs you can take a look at the tutorials of MiamiCoder, ModusCreate and this one..

0
votes

I just made sometime ago a fiddle that show how association works. You can see json example also.

When you catch the basics, rest should be easier to understand.

How associations works - Fiddle - by example