1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    5
    Vote Rating
    0
    rich9285 is on a distinguished road

      0  

    Default Answered: Logout Redirect in Controller

    Answered: Logout Redirect in Controller


    Hi All,

    I have a button for the user to logout and should redirect to the login page. I have a logout.jsp file that handles the redirect. How do I call the file in my controller? I posted my controller code below.

    Ext.define('UI.controller.LogoutController', {
    extend : 'Ext.app.Controller',

    views : ['HomePageHeader'],

    init : function() {
    console.log('INFO : Logout controller initiated');
    this.control({
    'menu component[action=logoutClick]' : {
    click : this.onLogoutClick,

    }
    });
    },

    onLogoutClick : function() {
    Ext.Ajax.request({
    url: 'portalUI/logout.jsp'

    })

    }


    })


    Thanks in advance.

  2. See if this works for you

    Code:
    onLogoutClick: function () {
        window.location = 'portalUI/logout.jsp';    //redirects to url
    }

  3. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,062
    Vote Rating
    215
    Answers
    486
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    See if this works for you

    Code:
    onLogoutClick: function () {
        window.location = 'portalUI/logout.jsp';    //redirects to url
    }

  4. #3
    Sencha User
    Join Date
    Dec 2012
    Posts
    5
    Vote Rating
    0
    rich9285 is on a distinguished road

      0  

    Default


    It worked. Thank you very much

Thread Participants: 1