samedi 5 juillet 2014

Direct won't work in Login, works elsewhere in app

Code:



Ext.define('ServcSol.Application', {
extend: 'Ext.app.Application',

name: 'ServcSol',

requires:[
'ServcSol.DirectAPI',
'Ext.form.action.DirectSubmit'
],

views: [
'manyviewshere' ],

controllers: [
'manycontrollershere' ],

stores: [
'manystoreshere' ],

launch: function () {
var win = Ext.create('Ext.window.Window', {
closable : false,
resizable : false,
draggable : false,
border : false,
title: 'Service Solutions',
titleAlign: 'left',
height: 800,
width: 1000,
api: {
submit: 'ExtRemote.DXLogin.authenticate'
},
paramOrder: ['username', 'pwd'],
layout: {
type: 'vbox',
align: 'center',
pack: 'center'
},
items: [
{
xtype: 'form',
title: 'Login',
itemId: 'login',
height: 300,
width: 300,
frame: true,
layout: {
type: 'vbox',
align: 'center'
},
items:[
{
xtype: 'textfield',
margin: '30 0 0 0',
itemId: 'username',
fieldLabel: 'User Name',
allowBlank: false,
name: 'username',
emptyText: 'Username',
width: 225,
labelWidth: 100
},
{
xtype: 'textfield',
margin: '10 0 0 0',
inputType: 'password',
fieldLabel: 'Password',
allowBlank: false,
name: 'pwd',
emptyText: 'Password',
width: 225,
labelWidth: 100
},
{
xtype: 'button',
text: 'Login',
margin: '20 0 0 0',
itemId: 'loginBtn',
width : 80,
formBind: true,
handler: function(){
var loginFrm = Ext.ComponentQuery.query('#login')[0];
loginFrm.getForm().submit({
success: function(form, action)
{
Ext.create('ServcSol.view.Viewport');
win.destroy();
},
failure: function(form, action)
{
console.log('Login Failed');
}
});
}
}
]}
]
})
win.show();
}

});




Aucun commentaire:

Enregistrer un commentaire