JavaScript - cerrar sesion en un JS

 
Vista:

cerrar sesion en un JS

Publicado por Alvaro (3 intervenciones) el 06/02/2013 21:05:06
hola, necesito su ayuda, estoy trabajando con la libreria de Sencha, y pues necesitaria apoyo para poder cerrar una sesion cuando se selecciona la opcion salir, les comparto el codigo y agradecere mucho su apoyo.

Ext.define('MyDesktop.App', {
extend: 'Ext.ux.desktop.App',

requires: [
'Ext.window.MessageBox',

'Ext.ux.desktop.ShortcutModel',

'MyDesktop.SystemStatus',
//'MyDesktop.VideoWindow',
'MyDesktop.GridWindow',
'MyDesktop.TabWindow',
'MyDesktop.AccordionWindow',
'MyDesktop.Notepad',
'MyDesktop.BogusMenuModule',
'MyDesktop.BogusModule',

// 'MyDesktop.Blockalanche',
'MyDesktop.Settings'
],

init: function() {
// custom logic before getXYZ methods get called...

this.callParent();

// now ready...
},

getModules : function(){
return [
//new MyDesktop.VideoWindow(),
//new MyDesktop.Blockalanche(),
//new MyDesktop.SystemStatus(),
new MyDesktop.GridWindow(),
new MyDesktop.TabWindow(),
new MyDesktop.AccordionWindow(),
new MyDesktop.Notepad(),
new MyDesktop.BogusMenuModule(),
new MyDesktop.BogusModule()
];
},

getDesktopConfig: function () {
var me = this, ret = me.callParent();

return Ext.apply(ret, {
//cls: 'ux-desktop-black',

contextMenuItems: [
{ text: 'Cambiar Opciones', handler: me.onSettings, scope: me }
],

shortcuts: Ext.create('Ext.data.Store', {
model: 'Ext.ux.desktop.ShortcutModel',
data: [
{ name: 'Reportes', iconCls: 'grid-shortcut', module: 'grid-win' },
{ name: 'Usuarios', iconCls: 'accordion-shortcut', module: 'acc-win' },
{ name: 'Notepad', iconCls: 'notepad-shortcut', module: 'notepad' },
//{ name: 'Reproductor Video', iconCls: 'video-shortcut', module: 'video'}
]
}),

wallpaper: 'wallpapers/Blue-Sencha.jpg',
wallpaperStretch: false
});
},

// config for the start menu
getStartConfig : function() {
var me = this, ret = me.callParent();

return Ext.apply(ret, {
title: 'Alvaro Ambicho',
iconCls: 'user',
height: 300,
toolConfig: {
width: 100,
items: [
{
text:'Opciones',
iconCls:'settings',
handler: me.onSettings,
scope: me
},
'-',
{
text:'Salir',
iconCls:'logout',
handler: me.onLogout,
scope: me
}
]
}
});
},

getTaskbarConfig: function () {
var ret = this.callParent();

return Ext.apply(ret, {
quickStart: [
{ name: 'Usuarios', iconCls: 'accordion', module: 'acc-win' },
{ name: 'Reportes', iconCls: 'icon-grid', module: 'grid-win' }
],
trayItems: [
{ xtype: 'trayclock', flex: 1 }
]
});
},

onLogout: function () {
Ext.Msg.confirm('Salir', 'Esta seguro que Desea Salir del Sistema?');
var redirect ='../login/index.php'//agregado
},

onSettings: function () {
var dlg = new MyDesktop.Settings({
desktop: this.desktop
});
dlg.show();
}
});
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder