View Full Version : NavigationView doesn't navigate to other view

29 Jan 2013, 3:31 AM

I am beginner in sencha and working with NavigationView control. I have two views viewOne.js and viewTwo.js. I want to navigate from viewOne.js to viewTwo.js. How can I do this? I am using below code:

var view = Ext.create('Ext.NavigationView', {
fullscreen: true,
items: [{
title: 'First',
items: [{
xtype: 'button',
text: 'Push a new view!',
handler: function () {
// use the push() method to push another view. It works much like
// add() or setActiveItem(). it accepts a view instance, or you can give it
// a view config.

29 Jan 2013, 4:21 AM
You have to push an instance of a view, not the name of a class.

So you'd need to, for instance, do something like this:


Where ViewTwo is the class name of the second view.

Take a look at the MVC features of Sencha Touch 2 also. Ideally you'd push/pop views from a controller, and you'd have ViewTwo named something like MyApp.view.ViewTwo .

For future, I think the Q&A forum is for specific issues people have with their code - you're more likely to get a prompt response there next time!

29 Jan 2013, 4:54 AM
Thanks! Shepsii. I just implemented the way you told me now it's working. From next time I will post my thread in Q&A forum.