PDA

View Full Version : Good start for an Application



myput
19 Sep 2011, 12:53 AM
Hello,
After reading tutorials, examples and do some little applications with that,
i'm trying to begin a real application.
But i have some questions due to some bugs i meet.
All tutorials shows code in app.js, in launch function, or in viewport view.

But i would like to have my app.js calling viewport, and viewport who call all views and shw that with a tabPanel...
then; i did in Viewport:


tabBar: {
dock: 'bottom',
layout: {
pack: 'center',
},
},
items: [
{xtype: 'viewHome'},
{xtype: 'viewSearch'},
{xtype: 'viewCredit'},
],


Its working for simple views ... But in my Home View, i have a nestedList for example,
I'm trying to fight with data, use "this" for call the stores etc ... and nothing work.



myApp.views.ViewHome = Ext.extend(Ext.NestedList, {
title: 'Home',
iconCls: 'home',
scroll: 'vertical',
initComponent: function(){
// Normal code for NestedList like turorial
myApp.views.ViewHome.superclass.initComponent.call(this);
}
});


Ext.reg('viewHome', myApp.views.ViewHome);




But the same code work if i just copy the code in app.js or if i don't use a TabPanel ...
And it's the same with my geoLocation function who display my informations only if i use 'this' etc ...
bug makes bug in TabPanel or don't show him.

I would like to know what is the greatest start for have a viewport; who contain a TabPanel; and call views into this tabPanel without problems.

I saw some applications, who call views and hide or destroy other views, and return tabPanel or i don't really know, but i don't understand.

Can you explain me what is the best way for beginning an application with some tabPanel and call different Views ...

Thanks for helping me :)

existdissolve
19 Sep 2011, 5:06 PM
@myput--

I'll let others weigh in on the best ways to do things, but I've done something similar (main TabPanel layout) on an app I currently have in development:

http://beta.cfgloss.com/mobile

Mind you, it's still a work in progress, but there might be something helpful in there.

myput
19 Sep 2011, 11:12 PM
Yes, its a little what i would like to do. Nice App existdissolve, it will be good.

And you have follow simply tutorials of sencha learn or it's completely a custom list?
Cause i tried many things, and i would like to follow the way of the tuto, but it's impossible with a complete application and some views.

existdissolve
20 Sep 2011, 1:45 AM
Hi @myput--

I followed parts of this tutorial (http://myxaab.wordpress.com/2011/02/27/sencha-touch-mvc-application-part-2/), and then filled in some other pieces just through trial and error.