大師,我是JS的新手。我收到一個錯誤,「無法找到方法createEntitlementTree」。你能幫我怎麼寫和調用這個方法嗎?在此先感謝您的幫助。OO JavaScript方法調用問題
Ext.define('Myviews.UserGroupManagerPanel', {
extend: 'Ext.panel.Panel',
.......
createUserGroupForm: function(){
this.gridPanel = Ext.create('Ext.FormPanel', {
region: 'center',
collapsible: false,
floatable: false,
items: [
{
xtype: 'textfield',
name: 'userGroupName',
fieldLabel: 'User Group Name',
width: 210
},
createEntitlementTree()
]
});
return this.gridPanel;
},
createEntitlementTree: function() {
return Ext.create('Ext.tree.Panel', {
border: true,
rootVisible: false,
useArrows: true,
frame: true,
title: 'Entitlements',
width: 300,
height: 350,
initComponent: function() {
this.store = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: '/TradeHubSVN/admin/getAllEntitlements.json'
}
});
this.callParent(arguments);
}
});
}
應從[樣本](http://sscce.org/)中刪除無關代碼,並着眼於使其完整,簡潔和具有代表性。 – outis
SO使用問答網站,而不是論壇。評論不適用於一般消息。如果答案是有幫助的,則對其進行投票。如果它解決了你的問題,[接受](http://meta.stackexchange.com/questions/5234/)它。考慮選擇一個[有意義的用戶名](http://tinyurl.com/so-hints)。這樣做的一個好處是其他人可以使用[at-replies](http://meta.stackexchange.com/questions/43019/how-do-comment-replies-work),你會得到一個有人向你發出的通知在評論中。 – outis