Hi, I am trying to make a login for my app, and i do not understand the poor documentation, i need help...
can somebody help me?, give me and example or something please!!... thanks..
this is my code...
View
Code:
Ext.define('Scanner.view.Main', { extend: 'Ext.Container',
requires: [
'Ext.TitleBar'
],
config: {
ui: 'dark',
layout: {
type: 'vbox'
},
scrollable: false,
items: [
{
xtype: 'titlebar',
docked: 'top',
scrollable: false,
title: 'Scanner'
},
{
xtype: 'fieldset',
id: 'login',
ui: 'dark',
scrollable: false,
instructions: 'Ingresa los datos',
title: '<center>Login</center>',
layout: {
align: 'center',
pack: 'center',
type: 'vbox'
},
items: [
{
xtype: 'textfield',
id: 'usuario',
label: 'Còdigo Mensajero:',
maxLength: 15,
placeHolder: 'A2S3D4'
},
{
xtype: 'passwordfield',
flex: 1,
id: 'password',
label: 'Clave Mensajero:',
name: '',
maxLength: 15,
placeHolder: '******'
},
{
xtype: 'button',
id: 'sentButton',
ui: 'confirm-round',
text: 'Acceso'
}
]
}
]
}
});
Controller
Code:
Ext.define('Scanner.controller.Controller', { extend: 'Ext.app.Controller',
requires: [
'Ext.MessageBox'
],
config: {
refs: {
sentButton: '#sentButton',
usuario: '#usuario',
password: '#password'
},
control: {
"sentButton": {
tap: 'sendParametters'
}
}
},
sendParametters: function(button, e, options) {
if(this.getUsuario().getValue() === "" || this.getPassword().getValue() === ""){
Ext.Msg.alert('Informaciòn Usuario', 'Falta Informaciòn Requerida', Ext.emptyFn);
}
//I do not what to do here... here is where i guess that i should to send the parameters but i do not how
//can somebody help me?
}
});
Store
Code:
Ext.define('Scanner.store.MyJsonPStore', { extend: 'Ext.data.Store',
requires: [
'Scanner.model.MyModel'
],
config: {
model: 'Scanner.model.MyModel',
storeId: 'MyJsonPStore',
proxy: {
type: 'jsonp',
url: 'http://sicom.linux-si.com/cgi-bin/webapps/sicom/scanner.py',
reader: {
type: 'json'
},
writer: {
type: 'json'
}
}
}
});
Model
Code:
Ext.define('Scanner.model.MyModel', { extend: 'Ext.data.Model',
config: {
fields: [
{
name: 'messenger_code',
type: 'string'
},
{
name: 'password',
type: 'string'
},
{
name: 'action',
defaultValue: 'LOGIN',
type: 'string'
}
]
}
});