【发布时间】:2014-08-20 09:46:21
【问题描述】:
我明白了 未捕获的类型错误:无法读取未定义的属性“应用” 当我双击网格行时。我不确定为什么会这样。
我已阅读此内容 [How to access plugin in ExtJs MVC 和 [Uncaught TypeError: Cannot read property 'apply' of undefined with Sencha
这里是代码。
Ext.define('App.view.admin.PersonsGrid' ,{
extend:'Ext.grid.Panel',
requires: ['Ext.grid.plugin.RowEditing', 'Ext.toolbar.Paging'],
alias:'widget.admin-personsgrid',
title:'People',
itemId:'personGrid',
autoScroll:true,
selType: 'rowmodel',
plugins: [
{
ptype: 'rowediting',
//clicksToEdit: 1,
clicksToMoveEditor: 2,
autoCancel: false,
pluginId: 'rowediting'
}
],
],
tbar:[
{text:'Add Person', itemId:'add'},
{text:'Edit Person', itemId:'edit'},
{text:'Remove Person', itemId:'remove'},
'->',
'Search:',
{
xtype:'textfield',
name:'searchValueField',
width:200,
},
{
text:'Submit',
itemId: 'submit',
}
],
initComponent: function() {
this.store = Ext.create('Ext.data.Store',{
model:'App.model.Person',
remoteFilter:true,
remoteSort:true,
pageSize:100
});
this.columns = [
{
text:'Last Name', dataIndex:'lastName',
editor: {xtype: 'textfield', allowBlank: false}
},
{
text:'First Name', dataIndex:'firstName',
editor: {xtype: 'textfield', allowBlank: false}
},
{
text:'Email', dataIndex:'email',
editor: {vtype: 'email', allowBlank: false}
},
{
text:'Org Unit', dataIndex:'orgUnitName',
editor: {xtype: 'textfield', allowBlank: false},
},
{
text:'Location', dataIndex:'name', editor: {
xtype: 'textfield', allowBlank: false}
},
{
text:'Office Phone', dataIndex:'officePhone',editor: {
xtype: 'textfield', allowBlank: false},
},
{
text:'Mobile Phone', dataIndex:'mobilePhone',editor: {
xtype: 'textfield', allowBlank: false}
},
{
text:'Home Phone', dataIndex:'homePhone',editor: {
xtype: 'textfield', allowBlank: false}
}
];
this.dockedItems = [
{
xtype: 'pagingtoolbar',
ui: 'footer',
defaultButtonUI: 'default',
dock: 'bottom',
displayInfo: true,
store: this.store
}
];
this.callParent( arguments );
}
});
【问题讨论】:
标签: model-view-controller grid extjs4