title: set field dynamically in the store in extjs or getCount() gives 0 in model
body: <p>Hope you are doing good.</p>
  
  <p>I have 2 different class University and Students</p>
  
  <p>Relation : University hasMany Students</p>
  
  <p>University fields: uni_id, uni_name,total_students
  Students fields: stud_id,stud_name</p>
  
  <p>I have following json file:</p>
  
  <pre><code>{
      "data": [
          {
              "uni_id": 1,
              "uni_name": "Gujarat University",
              "openingYear": 1980,
              "students": [
                  {
  
                      "stud_id": 1,
                      "stud_name": "Rishabh Shah"
                  }, {
  
                      "stud_id": 2,
                      "stud_name": "Rakesh Prajapati"
                  }, {
  
                      "stud_id": 3,
                      "stud_name": "Vaibhavi Shah"
                  }, {
  
                      "stud_id": 4,
                      "stud_name": "Jitu Mishra"
                  }, {
  
                      "stud_id": 5,
                      "stud_name": "Sonu Nigam"
                  }, {
  
                      "stud_id": 6,
                      "stud_name": "K.K."
                  }, {
  
                      "stud_id": 7,
                      "stud_name": "Amitabh Bachan"
                  }
              ]
          }, {
              "uni_id": 2,
              "uni_name": "Saurastra University",
              "openingYear": 1985,
              "students": [
                  {
  
                      "stud_id": 1,
                      "stud_name": "Rakhi Sawant"
                  }, {
  
                      "stud_id": 2,
                      "stud_name": "Smit Patel"
                  }, {
  
                      "stud_id": 3,
                      "stud_name": "Kashyap Thaker"
                  }
              ]
          }, {
              "uni_id": 3,
              "uni_name": "North Gujarat University",
              "openingYear": 1989,
              "students": [
                  {
  
                      "stud_id": 1,
                      "stud_name": "Angellina Jollie"
                  }, {
  
                      "stud_id": 2,
                      "stud_name": "Parag Raval"
                  }, {
  
                      "stud_id": 3,
                      "stud_name": "Harshal Patel"
                  }, {
  
                      "stud_id": 4,
                      "stud_name": "Harsha Bhogle"
                  }, {
  
                      "stud_id": 5,
                      "stud_name": "Lata Mangeshkar"
                  }
              ]
          }, {
              "uni_id": 4,
              "uni_name": "South Gujarat University",
              "openingYear": 1989,
              "students": [
                  {
  
                      "stud_id": 1,
                      "stud_name": "Khushbu Shah"
                  }, {
  
                      "stud_id": 2,
                      "stud_name": "Piyush"
                  }, {
  
                      "stud_id": 3,
                      "stud_name": "Sakira"
                  }, {
  
                      "stud_id": 4,
                      "stud_name": "Salman Khan"
                  }, {
  
                      "stud_id": 5,
                      "stud_name": "Kishor Kumar"
                  }, {
  
                      "stud_id": 6,
                      "stud_name": "Mohhamad Rafi"
                  }, {
  
                      "stud_id": 7,
                      "stud_name": "V.V.S. Lakshman"
                  }, {
  
                      "stud_id": 8,
                      "stud_name": "Rahul Dravid"
                  }, {
  
                      "stud_id": 9,
                      "stud_name": "Shane Worn"
                  }, {
  
                      "stud_id": 10,
                      "stud_name": "Neel Armstrong"
                  }
              ]
          }
      ]
  }
  </code></pre>
  
  <p>I want to load <strong>total_stud</strong> mentioned in University model.</p>
  
  <p>total_stud is no. of students in university..</p>
  
  <p>I tried with following things in University model.</p>
  
  <pre><code>fields:'total_stud', 
  type:integer,
  convert:function(value,record)
  {
  return record.students().getCount();
  }
  </code></pre>
  
  <p>I have also set total_stud, but, I get 0 total_stud. when i see the record.students(), I get all the students with that university..but, why I am not getting getCount().</p>
  
  <p>Thanks ! :)</p>