O'Reilly logo

Enterprise Application Development with Ext JS and Spring by Gerald Gierer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining our models

Our Project, Task, and TaskLog models were created with basic fields using Sencha Cmd in Chapter 9, Getting Started with Ext JS 4, but they lacked in persistence or validation logic. It is now time to add the required code.

The TaskLog Model

The TaskLog model is the most complicated model in our application. The complete TaskLog model with all required logic is as follows:

Ext.define('TTT.model.TaskLog', {
    extend: 'Ext.data.Model',    
    fields: [
        { name: 'idTaskLog', type: 'int', useNull:true },
        { name: 'taskDescription', type: 'string' },
        { name: 'taskLogDate', type: 'date', dateFormat:'Ymd' }, { name: 'taskMinutes', type: 'int' }, { name: 'hours', type: 'float', persist:false, convert:function(value, record){ return record.get('taskMinutes') ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required