The following code is part from my Controller class;
1.) When the code enters the Success or Failure blocks, i need the program to navigate to another view, which will show the Registration View or Information View.
Ext.Ajax.request({
url: 'http://call.com/the_webservice',
params : values,
failure: function (response) {
var text = response.responseText;
// SHOW SIGN UP SCREEN
}, success: function (response) {
var text = response.responseText;
// GO TO ANOTHER VIEW AND IT WILL SHOW THE USER WITH SOME INFORMATION
}
});
UPDATE
In app.js
views: ['Main','HomePage','Register'],
and
launch: function() {
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
// Initialize the main view
Ext.Viewport.add(Ext.create('app.view.Main'));
Ext.Viewport.add(app.view.Register);
},
Then in the ControllerPage.js on button press…
success: function (response) {
var text = response.responseText;
var result = Ext.decode(response.responseText);
Ext.Viewport.setActiveItem(0);
console.log("success");
}
the console log, success gets printed, but the view doesn’t navigate to the Register View
UPDATE 2
I have not used tabPanel, In my code i have used tabBarPosition: 'bottom', to display tabs bottom of the screen. Can you show me how to navigate between views, which includes the tabbarpanel as well. The following code is my Main.js, and this is where i have included tabs.
Ext.define("app.view.Main", {
extend: 'Ext.tab.Panel',
config: {
tabBarPosition: 'bottom',
items: [
{
xtype:'formReq'
}
]
}
});
Your question is not very precise.
Nevertheless, if you are asking how to navigate between pages, it all depends how they are set up.
Assuming you added your two views (RegistrationView and InformationView) to the app viewport (Ext.ViewPort):
then all you have to do is the following:
This is just one way of doing it (maybe not the best).
hope this helps.