I currently have a store with a list of people and it contains certain details about them (ie. name, position, age).
My goal is to have two fields at the top of my page - one which gets the total count of students and the other gets the total count of teachers.
What is the best way to do this?
{
xtype: 'numberfield',
name: 'studentcount',
fieldLabel: 'Student Count',
minValue: 0,
readOnly: true,
},
{
xtype: 'numberfield',
name: 'teachercount',
fieldLabel: 'Teacher Count',
minValue: 0,
readOnly: true
}
columns:[
{ text: 'Name', dataIndex: 'name', editor:'textfield'},
// position is either 'student' or 'teacher'
{ text: 'Position', dataIndex: 'position', editor:'textfield'},
{ text: 'Age', dataIndex: 'age', editor:'textfield'},
]
let store = Ext.create('schoolstore',{
listeners: {
'update': function(store, record){
}
}
})
**Name - Position - Age**
John, Teacher, 44
Andrew, Teacher, 40
Stan, Student, 15
Jane, Student, 14
Alice, Student, 16
Mark, Teacher, 50
I'm new to using ExtJS so any help at all is appreciated, I'm not even sure if using the update listener is the correct way to begin?
I have looked elsewhere including the Sencha forums (which seem to be down at the moment?) but I can't seem to get a specific answer to my issue.