1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    2
    Vote Rating
    0
    Raj_Singh is on a distinguished road

      0  

    Default not able to change view after login page

    not able to change view after login page


    login.jpg
    I am new in Sencha Touch 2....
    I have created a login page but not able to change my view after login. I have put here my all code please help ...thanks in advance ..

    my app.js code is here...


    //<debug>
    Ext.Loader.setPath({
    'Ext': 'sdk/src'
    });
    //</debug>


    Ext.application({
    name: 'hawk',


    requires: [
    'Ext.MessageBox'
    ],


    views: ['Main','login','home'],


    icon: {
    57: 'resources/icons/Icon.png',
    72: 'resources/icons/Icon~ipad.png',
    114: 'resources/icons/Icon@2x.png',
    144: 'resources/icons/Icon~ipad@2x.png'
    },

    phoneStartupScreen: 'resources/loading/Homescreen.jpg',
    tabletStartupScreen: 'resources/loading/Homescreen~ipad.jpg',


    launch: function() {
    // Destroy the #appLoadingIndicator element
    Ext.fly('appLoadingIndicator').destroy();


    // Initialize the main view
    Ext.Viewport.add(Ext.create('hawk.view.Main'));
    },


    onUpdated: function() {
    Ext.Msg.confirm(
    "Application Update",
    "This application has just successfully been updated to the latest version. Reload now?",
    function() {
    window.location.reload();
    }
    );
    }
    });


    my main.js here.................


    Ext.define("hawk.view.Main", {
    extend: 'Ext.tab.Panel',
    xtype:'mainpanel',
    requires: ['Ext.TitleBar'],

    config: {
    tabBarPosition: 'bottom',

    items: [
    {
    xtype:'loginform'
    }

    ]
    }


    });


    my login.js is here..............


    Ext.define('hawk.view.login',{
    extend:'Ext.form.Panel',
    xtype:'loginform',

    requires:[
    'Ext.form.FieldSet',
    'Ext.field.Email',
    'Ext.field.Password'
    ],

    config:{
    title:'Login',
    iconCls:'user',
    url:'Login.php',

    items:[{

    xtype:'fieldset',
    title:'Sign in',

    items:[
    {
    xtype:'emailfield',
    name:'email',
    label:'Email'

    },
    {
    xtype:'passwordfield',
    name:'password',
    label:'Password'
    }]
    },
    {
    xtype:'button',
    text:'Sign in',
    ui:'confirm',
    handler:function(){

    Ext.Ajax.request({
    url: 'Login.php',
    method: 'post',
    params: {UserName: 'user', Password : 'pass'},
    failure : function(response){
    Ext.Msg.alert('Login Error');
    data = Ext.decode(response.responseText);
    Ext.Msg.alert('Login Error', data.errorMessage, Ext.emptyFn);
    },
    success: function(response, opts) {
    Ext.Msg.alert('Login succes' );


    var notesListContainer = Ext.create('hawk.view.home');
    Ext.Viewport.add(notesListContainer);


    Ext.Msg.alert('---------' );




    }
    });



    }
    }

    ]
    }
    })



    my home.js is here.......This is test page only which I want show after login .....


    Ext.define('hawk.view.home',{
    extend: 'Ext.tab.Panel',
    xtype:'hamepanel',
    config:{
    title:'Home',
    iconCls:'home',

    html: [
    '<img src="http://staging.sencha.com/img/sencha.png" />',
    '<h1>Welcome to Sencha Touch</h1>',
    "<p>You're creating the Getting Started app. This demonstrates how ",
    "to use tabs, lists and forms to create a simple app</p>",
    '<h2>Sencha Touch (2.0.0)</h2>'
    ].join("")

    }
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    All you have to do is add the home view to the Main class and remove the login.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    2
    Vote Rating
    0
    Raj_Singh is on a distinguished road

      0  

    Default


    I have change like this now .......

    my Main.js is look like this...


    Ext.define("hawk.view.Main", {
    extend:'Ext.form.Panel',
    xtype:'mainpanel',


    requires:[
    'Ext.form.FieldSet',
    'Ext.field.Email',
    'Ext.field.Password',
    'Ext.TitleBar'
    ],

    config:{
    title:'Login',
    iconCls:'user',
    url:'Login.php',

    items:[{

    xtype:'fieldset',
    title:'Sign in',

    items:[
    {
    xtype:'emailfield',
    name:'email',
    label:'Email'

    },
    {
    xtype:'passwordfield',
    name:'password',
    label:'Password'
    }]
    },
    {
    xtype:'button',
    text:'Sign in',
    ui:'confirm',
    handler:function(){
    // this.up('loginform').submit();
    //display Loading indicator to user
    // loginform.setLoading(true, false);

    // var email = Ext.getCmp('email').getValue();
    //var pass = Ext.getCmp('password').getValue();
    Ext.Ajax.request({
    url: 'Login.php',
    method: 'post',
    params: {UserName: 'user', Password : 'pass'},
    failure : function(response){
    Ext.Msg.alert('Login Error');
    data = Ext.decode(response.responseText);
    Ext.Msg.alert('Login Error', data.errorMessage, Ext.emptyFn);
    },
    success: function(response, opts) {
    Ext.Msg.alert('Login succes' );
    //viewport[0].setActiveItem(target[0]);

    var notesListContainer = Ext.create('hawk.view.home');
    Ext.Viewport.add(notesListContainer);


    Ext.Msg.alert('---------' );
    //Ext.Viewport.setActiveItem('home', 'slide');
    /*
    data = Ext.decode(response.responseText);
    if (data.errorMessage != null)
    {
    Ext.Msg.alert('Login Error', data.errorMessage, Ext.emptyFn);
    mainpanel.setLoading(false);
    } else {
    //hide the Loading mask
    mainpanel.setLoading(false);
    //show the next screen
    mainpanel.setActiveItem(home, 'slide');
    }

    */
    }
    });



    }
    }

    ]
    }
    })


    and now i have remove login.js but still it is not working .....pls help I am totally new...

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."