0

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.

Guilherme Lopes
  • 4,688
  • 1
  • 19
  • 42
user3127109
  • 3,421
  • 8
  • 24
  • 33

2 Answers2

0

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..

Tarabass
  • 3,132
  • 2
  • 17
  • 35
0

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

Paweł Głowacz
  • 2,926
  • 3
  • 18
  • 25