在extjs中添加控制器时视图不显示
View is not displaying on adding the controller in extjs
当我从中删除StudentControllerrequire []在List.js文件时,我的视图工作正常,但是当我包含StudentController时,没有显示任何内容。
这是我的List.js,它需要StudentController
Ext.define('MyApp.view.main.List', {
extend: 'Ext.grid.Panel',
xtype: 'mainlist',
requires: [
'MyApp.store.Student',
'MyApp.view.main.StudentController',
'MyApp.store.Faculty'
],
title: 'Student Records',
scrollable: true,
margin: 20,
layout: {
type: 'vbox',
align: 'stretch'
},
controller: 'student',
reference: 'studentGrid',
frame: true,
collapsible: true,
store: {
type: 'student'
},
collapsible: true,
columns: [
{
header: 'Name',
dataIndex: 'name',
editor: 'textfield',
sortable: true,
flex: 1
},
{
header: 'Address',
dataIndex: 'address',
editor: {
xtype: 'textfield',
allowBlank: false
},
flex: 1
},
{
header: 'Phone',
dataIndex: 'phone',
editor: 'textfield',
flex: 1
},
{
header: 'Gender',
dataIndex: 'gender',
flex: 1
}
],
selModel: 'rowmodel',
plugins: {
ptype: 'rowediting',
clicksToEdit: 1
},
dockedItems: [
{
xtype: 'toolbar',
dock: 'top',
items: [
// items to add
}]
}
],
});这里是我的StudentController
Ext.define('Ext.view.main.StudentController', {
extend: 'Ext.app.ViewController',
alias: 'controller.student',
onAdd: function(button, e, options)
{
this.createDialog(null);
},
createDialog: function(record)
{
var me = this,
view = me.getView();
me.dialog = view.add({
xtype: 'student-form',
viewModel: {
data: {
title: record ? 'Edit:' + record.get('name') : 'Add User'
},
links: {
currentUser: record || {
type: 'User',
create: true
}
}
}
})
me.dialog.show();
},
});
为什么在中添加StudentController需要[]在List.js而在删除它时一切正常
为什么在require中添加StudentController没有结果[]在List.js中,而在删除它时,一切正常
因为没有定义MyApp.view.main.StudentController
类(因此,不能满足require
指令)。相反,您有Ext.view.main.StudentController
,这是实际工作时,require
没有不存在的类在其中列出。
相关文章:
- 将日期时间作为 JSON 发送将无法在我的视图中正确显示
- FF视图源|脚本高亮显示为红色
- 有没有比在app.js上绑定模块名称更好的方法来动态加载视图模型和视图以显示模态
- 如何在MVC3中显示鼠标悬停在文本上的部分视图
- 如何应用带过滤器的ng if来过滤记录,并在同一页面中显示两个不同的视图
- 为什么我的视图没有显示在角度ui视图中
- 使用PhoneGap和jQuery Mobile在android设备上显示动态列表视图
- 使用Ruby数组使用JS在视图中进行迭代和显示
- 滑动视图 - 显示下一项的预览/片段
- 在剃须刀应用程序中将视图显示为灯箱
- ember.js如何为视图显示不同的筛选列表?复杂的设置
- ng重复视图显示与JSON数据不对应
- RedirectToAction之后没有视图显示
- ASP.. NET MVC控制器/视图显示本地时间
- 离子弹出窗口视图显示在离子模态视图后面
- WinJs列表视图显示:无带ID的tile
- 完整的日历视图显示goToDate分前,下和今天
- 如何从父数组视图显示子对象视图
- CouchApp视图显示将为空结果
- 在树状视图显示中只打开一个li节点