/** * The main application class. An instance of this class is created by app.js when it * calls Ext.application(). This is the ideal place to handle application launch and * initialization details. */ Ext.define('test.Application', { extend: 'Ext.app.Application', name: 'test', requires: [ 'Ext.MessageBox', 'Ext.app.ViewModel' ], stores: [ // TODO: add global / shared stores here ], launch: function () { Ext.Viewport.add({ xtype: 'formpanel', title: 'test', viewModel: { data: { field1: 'abc', field2: 'def', field3: 'ghi' } }, layout: 'card', items: [ { xtype: 'toolbar', docked: 'bottom', items: [ { xtype: 'button', text: 'submit', handler: function() { var panel = this.up('formpanel'), fields = panel.getFields(), errors = '', valid; panel.validate(); valid = panel.isValid(); if (!valid) { errors = Object.keys(fields).map(function(key) { var field = fields[key]; if (!field.isValid()) { return '