Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    31
    Vote Rating
    0
    clabasky is on a distinguished road

      0  

    Default logout button

    logout button


    hello sencha friends,

    I'm trying to implement a "logout" button on my app. all I want it to do is refresh the entire webpage when clicked, which will clear the memory proxy for all my stores and essentially logout the user. does anyone know how to refresh the webpage that contains the app?

    Thanks!

  2. #2
    Sencha Premium Member
    Join Date
    May 2008
    Location
    Pasadena, California
    Posts
    172
    Vote Rating
    2
    NickT is on a distinguished road

      0  

    Default


    most of this is superfluous. you can set the window.location.href to itself and that will do it

    Code:
    {                    xtype:'button',
                        text: 'Logout',
                        ui:'mask',
                        handler: function(button) {
                            Ext.Ajax.request({
                                url: vm.environ.server.routePrefix + '/logout',
                                method: 'POST',
                                success: function(response, opts) {
                                    var responseObj = Ext.decode(response.responseText);
                                    if (responseObj.success) {
                                        window.location.href = window.location.href;
                                    }
                                    else {
                                        panelLaunch({
                                            iconClass: 'x-panel-action-icon-tick',
                                            position: 'br',
                                            actionMethod: ['hide']
                                        }, responseObj.message);
                                    }
                                },
                                failure: function(response, opts) {
                                    var responseText = (response.responseText ? response.responseText : 'Unable to contact the server.  Please try again later.');
                                    panelLaunch({
                                        iconClass: 'x-panel-action-icon-tick',
                                        position: 'br',
                                        actionMethod: ['hide']
                                    }, responseText);
                                },
                                scope: this
                            });
                        }
                    }

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    31
    Vote Rating
    0
    clabasky is on a distinguished road

      0  

    Default works great~!

    works great~!


    that did the trick!!!

    Code:
    logout: function() {
    	 Ext.Msg.confirm('logout?', 'are you sure you want to logout?', function(answer) {
            if (answer === "yes") {
    	
    //refreshes the page, erasing memory proxy
    window.location.href = "";
    }

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    31
    Vote Rating
    0
    clabasky is on a distinguished road

      0  

    Default the plot thickens

    the plot thickens


    the above code worked great when i tested on local host, but when i loaded it on my ftp and tried it on my phone, it didn't load the new page
    Code:
    window.location.href = "";
    then i tried

    Code:
    window.location.href = "foodrides.com/app";  //url for my the location of my app
    and that refused to work as well..

    any ideas of how to refresh the current browser page on the ftp??

  5. #5
    Sencha Premium Member
    Join Date
    May 2008
    Location
    Pasadena, California
    Posts
    172
    Vote Rating
    2
    NickT is on a distinguished road

      0  

    Default


    you may have tried it, but did it not work when you just reset the href to itself? I noticed you set it to empty string

    Code:
    window.location.href = window.location.href;
    I was able to get things working both on mobile and desktop with that approach

  6. #6
    Sencha User
    Join Date
    Sep 2011
    Posts
    31
    Vote Rating
    0
    clabasky is on a distinguished road

      0  

    Default functional

    functional


    yep, that worked perfectly!!! I should have followed the exact code from the first answer.. thanks again!!!!!

Thread Participants: 1