使用EXT4报错!大神快来看~求解决 - Web 开发 / Ajax
学习搭建ext4的MVC,报错~
错误是:例外被抛出且未被接住 ext-all-debug.js
我的代码是:
app:
Ext.application({ name:'AM', appFolder:'js', controllers:["Users"], launch: function () { Ext.create('Ext.container.Viewport', { layout: 'fit', items: [{ xtype: 'userlist' }] }); }});
Ext.define('AM.controller.Users', { extend: 'Ext.app.Controller', views: [ 'List', 'Edit' ], stores:[ "Users" ], models:["User"], init: function () { this.control({ 'userlist': { itemdblclick: this.editUser } }); }, editUser: function(grid, record) { console.log('Double clicked on ' + record.get('name')); }});
Ext.define('AM.model.User', { extend: 'Ext.data.Model', fields: ['name', 'email']})
Ext.define('AM.store.Users', { extend: 'Ext.data.Store', model: 'AM.model.User', data: [ { name: 'Ed', email: 'ed@sencha.com' }, { name: 'Tommy', email: 'tommy@sencha.com' } ]});
Ext.define('AM.view.List', { extend: 'Ext.grid.Panel', alias: 'widget.userlist', title: 'All Users', initComponent: function () { this.store = "Users"; this.columns = [ { header: 'Name', dataIndex: 'name', flex: 1 }, { header: 'Email', dataIndex: 'email', flex: 1 } ]; this.callParent(arguments); }});