学习搭建ext4的MVC,报错~
错误是:例外被抛出且未被接住 ext-all-debug.js
我的代码是:
app:
- Java code
Ext.application({ name:'AM', appFolder:'js', controllers:["Users"], launch: function () { Ext.create('Ext.container.Viewport', { layout: 'fit', items: [{ xtype: 'userlist' }] }); } });
controller:
- Java code
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')); } });
model:
- Java code
Ext.define('AM.model.User', { extend: 'Ext.data.Model', fields: ['name', 'email'] })
store:
- Java code
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' } ] });
view:
- Java code
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); } });
求大神们解决啊~~~在线等~!!!
------解决方案--------------------
用firefox调试一下
------解决方案--------------------
------解决方案--------------------
你是不是导包的时候 导错包了