HP Anywhere API Reference
Defining the Data Model

The following code snippet is taken from Note.js. The file is under the app/model folder.

 
Ext.define("NotesApp.model.Note", {
    extend: "Ext.data.Model",
    config: {
        idProperty: 'id',
        fields: [
        { name: 'id', type: 'int' },
        ...
        ],
        validations: [
        { type: 'presence', field: 'id' },
        ...
        ]
    }
});