-
5 May 2011 9:21 PM #1
Class not available in refs
Class not available in refs
I have a tree structure in a panel on the left. And when i click a leaf, I want to show something different in the main panel. In other words, I need to access a dirrerent view from my controller. Here is the code for the Controller:
The problem seem to be that the safecustodies selector in the ref is undefined. I have debugged the Ext.ComponentManager in the itemclick event, and the component (grid) for the safecustodies xtype is not there. The only way I can get i there is to render the component somewhere on the screen during initialization. So my question is: How do you get a not rendered component to be registered in the ComponentManager?Ext.define('Service.controller.ObjectTrees', {
extend: 'Ext.app.Controller',
stores: ['ObjectTrees'],
models: ['ObjectTree'],
views: ['ObjectTree', 'domain.SafeCustody'],
refs: [
{ref: 'panel', selector: 'safecustodies'}
],
init: function() {
this.control({
'#objectTree': {
itemclick: this.onItemClicked
}
})
},
onItemClicked: function(tree, record, item, index, e) {
this.getPanel().show();
}
});
Here is the code for the class I need to be registered in the ComponentManager:
Model:
View:Ext.define('Service.model.domain.SafeCustody', {
extend: 'Ext.data.Model',
proxy: {
type: 'ajax',
url : 'js/data/depoter.json',
headers: 'Content-type: application/json',
reader: 'json'
},
fields: [{name: 'id', mapping: 'safeCustody.id'}, {name: 'adventDate', mapping: 'safeCustody.advent.aktivDato', type: 'date'}]
});
Controller:Ext.define('Service.view.domain.SafeCustody' ,{
extend: 'Ext.grid.Panel',
alias : 'widget.safecustodies',
title: 'Depoter',
width: 200,
height: 150,
store: 'domain.SafeCustodies',
columns: [
{text: 'Id', dataIndex: 'id'},
{text: 'Advent Dato', dataIndex: 'adventDate', xtype: 'datecolumn'}
]
});
Store:Ext.define('Service.controller.domain.SafeCustodies', {
extend: 'Ext.app.Controller',
stores: ['domain.SafeCustodies'],
models: ['domain.SafeCustody'],
views: ['domain.SafeCustody'],
init: function() {
}
});
Ext.define('Service.store.domain.SafeCustodies', {
extend: 'Ext.data.Store',
model: 'Service.model.domain.SafeCustody',
autoLoad: true
});
Similar Threads
-
is concept class is there in javascript?why extjs people are using the word class?
By saggammahesh in forum Community DiscussionReplies: 1Last Post: 27 Apr 2011, 4:00 AM -
getting object refs between overlapped modal windows
By Shining77 in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 14 Dec 2010, 10:53 AM -
Suggested extension to Ext refs
By bbimber in forum Community DiscussionReplies: 1Last Post: 15 Nov 2010, 11:42 AM -
from 3.2.0 to 3.0.3 - problem with scope / refs / autoref
By joelc in forum Ext Designer: Help & DiscussionReplies: 3Last Post: 16 Aug 2010, 11:16 PM -
jsb files on svn missing new button.js and button.css refs
By jarrod in forum Ext 1.x: BugsReplies: 2Last Post: 11 Dec 2006, 5:38 AM


Reply With Quote