Skip to content

Instantly share code, notes, and snippets.

@ashleycoker
Created December 3, 2015 15:12
Show Gist options
  • Save ashleycoker/d4b433a0af61b97f8c51 to your computer and use it in GitHub Desktop.
Save ashleycoker/d4b433a0af61b97f8c51 to your computer and use it in GitHub Desktop.
Ext.define('School.model.Student',
{
extend: 'Ext.data.Model',
requires:['School.model.Course'],
idProperty : 'id',
fields : [{
name : 'id',
type : 'int'
},
{
name : 'firstName',
type : 'string'
},
{
name : 'middleName',
type : 'string'
},
{
name : 'lastName',
type : 'string'
},
{
name : 'birthDate',
type : 'date'
},
{
name : 'address1',
type : 'string'
},
{
name : 'address2',
type : 'string'
},
{
name : 'city',
type : 'string'
},
{
name : 'state',
type : 'string'
}],
hasMany : [{
model : 'School.model.Course',
name : 'Courses'
}],
proxy :
{
type : 'ajax',
idParam : 'id',
id : 'senchatest',
reader :
{
type : 'json'
}
,
api :
{
read : '/Service/index.php/students'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment