fernando
30 Aug 2007, 1:14 PM
Hi Guy's,
To help make my code more readable I'm trying to package my widgets up into namspaces. I want to then call each of these from a 'co-ordinator' namespace which in turn is called from Ext.onReady inside the html header.
So in the html file I would have:
<script type="text/javascript">
Ext.onReady(coOrdinator.start.init, coOrdinator.start);
</script>
the co-ordinator would then be something like:
coOrdinator.app = function() {
return {
init : function() {
treeNameSpace.app.init_tree;
menuNameSpace.app.init_menu;
}
};
}();
The tree and menu files would then look like:
Ext.namespace('treeNameSpace');
treeNameSpace.app = function() {
return {
init_tree : function(){
//tree code here
}
However I'm having trouble with scope. I have been through the tutorials but I'm still not able to make this work.
What scope should the Ext.onReady be set to?
any suggestions would be much appreciated.
Tim
To help make my code more readable I'm trying to package my widgets up into namspaces. I want to then call each of these from a 'co-ordinator' namespace which in turn is called from Ext.onReady inside the html header.
So in the html file I would have:
<script type="text/javascript">
Ext.onReady(coOrdinator.start.init, coOrdinator.start);
</script>
the co-ordinator would then be something like:
coOrdinator.app = function() {
return {
init : function() {
treeNameSpace.app.init_tree;
menuNameSpace.app.init_menu;
}
};
}();
The tree and menu files would then look like:
Ext.namespace('treeNameSpace');
treeNameSpace.app = function() {
return {
init_tree : function(){
//tree code here
}
However I'm having trouble with scope. I have been through the tutorials but I'm still not able to make this work.
What scope should the Ext.onReady be set to?
any suggestions would be much appreciated.
Tim