Skip to content

Instantly share code, notes, and snippets.

@ashleycoker
Created December 3, 2015 15:12
Show Gist options
  • Select an option

  • Save ashleycoker/d4b433a0af61b97f8c51 to your computer and use it in GitHub Desktop.

Select an option

Save ashleycoker/d4b433a0af61b97f8c51 to your computer and use it in GitHub Desktop.

Revisions

  1. ashleycoker created this gist Dec 3, 2015.
    62 changes: 62 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    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'
    }

    }
    });