Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to navigate page in sencha touch2?
    primarykey
    data
    text
    <p>I am new in sencha touch and i am refer <a href="https://github.com/nelstrom/Sencha-Touch-tabs-and-toolbars-demo" rel="nofollow noreferrer">this project</a> for learning purpose.<br> In this project, i am trying to add login module, if login is successful then the other things is display (which is already in project). </p> <p>I made changes in <code>app.js</code> file and load login form(this is worked).<br> <code>app.js :</code></p> <pre><code>ToolbarDemo = new Ext.Application({ name: "ToolbarDemo", launch: function() { this.views.Home = new this.views.Home(); //this.views.viewport = new this.views.Viewport(); //this.views.homecard = this.views.viewport.getComponent('home'); } }); </code></pre> <p>and In <code>Home.js</code>, i create login screen and if username is not blank i want to redirect it to <code>Viewport.js</code> which contain other pages. </p> <p>I try some things which is commented in if blocks.</p> <p><code>Home.js :</code></p> <pre><code>ToolbarDemo.views.Home = Ext.extend(Ext.form.FormPanel, { fullscreen: true, title: 'Login', cls:'Loginscreen', id:'loginFormPanel', items: [ { html: '&lt;div align="center"&gt;&lt;img style="height: 100px; width: 100px;" src="stylesheets/images/main-logo.png" /&gt;&lt;/div&gt;' }, { xtype: 'fieldset', items: [ { xtype: 'textfield', name : 'name', id:'name', placeHolder : 'User Name', },{ xtype: 'passwordfield', name : 'password', placeHolder : 'Password', } ] }, { xtype: 'button', text: 'Login', cls:'LogingButton', ui: 'confirm', itemId:'loginbutton', handler: function() { var name = Ext.getCmp('name').getValue(); //var pass = Ext.getCmp('password').getValue(); if(name != '') { //ToolbarDemo.app.switchMainView('ToolbarDemo.view.Viewport'); //Ext.Viewport.setActiveItem(Ext.create('ToolbarDemo.view.Viewport')); //this.redirectTo('Viewport'); //var firststep = Ext.create('ToolbarDemo.view.Viewport'); //Ext.Viewport.setActiveItem(firststep); /*ToolbarDemo = new Ext.Application({ name: "ToolbarDemo", launch: function() { this.views.viewport = new this.views.Viewport(); this.views.homecard = this.views.viewport.getComponent('home'); } });*/ alert("aa"); } } } ], }); </code></pre> <p><code>Viewport.js :</code></p> <pre><code>ToolbarDemo.views.Viewport = Ext.extend(Ext.TabPanel, { fullscreen: true, xtype: 'viewport', initComponent: function() { Ext.apply(this, { tabBar: { dock: 'bottom', layout: { pack: 'center' } }, items: [ { xtype: 'homecard', id: 'home' }, { xtype: 'searchcard' }, { xtype: 'actioncard' }, { xtype: 'logincard' }, { xtype: 'settingscard' }, { xtype: 'morecard' } ] }); ToolbarDemo.views.Viewport.superclass.initComponent.apply(this, arguments); } }); </code></pre> <p>so how to navigate the page? I am try <a href="https://stackoverflow.com/questions/12800671/sencha-touch-redirect-to-another-view">this</a> and <a href="https://stackoverflow.com/questions/5754849/page-navigation-in-sencha-touch">this</a> but it is not helped.</p> <p><code>another quetion:</code></p> <p>I am also refer other tutorials and also the official website of sencha in which they use <code>controller,model and view</code> type patterns and in my project there is no <code>controller</code>. </p> <p>so which types of coding format should i follow that helped me to understand senchatouch? </p> <p>Is my project is good for practice?</p> <p>I refer diff. tutorials and i become confused. so what shoud i do? Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload