PDA

View Full Version : namespace



Dmoney
30 Jan 2011, 9:20 AM
I'm having trouble getting the namespace to work in sencha touch. I have searched the forums but I havent found an answer or the examples I have found are too complicated for my current abilities.

I have a namespace called maps with my map panel code in it like this :



Ext.ns('maps');

maps.mapPanel = new Ext.Panel({
fullscreen: true,

items: [{
xtype: 'map'
title: 'Map',
useCurrentLocation: true,
mapOptions: {
zoom: 12
}
}]
});


and I am trying to use maps.mapPanel as a card in my tabPanel like this



{
title: 'Search',
iconCls: 'search',
cls: 'card card5',
items: maps.mapPanel
}


Which isn't working. if I move mapPanel into the onReady of my main application file it works fine. Can someone tell me how you create a panel in a separate namespace?

mitchellsimoens
30 Jan 2011, 11:58 AM
You should have the namespace at top of your files.

Dmoney
30 Jan 2011, 1:01 PM
Thanks for replying. I do have my namespace declared at the top of my files. the first piece of code above is my entire maps.js file. my index.js which is my application file has the namespace of Ext.ns('Application');