ExtJS: Login with 'Remember me' functionality
Posted
by Chau
on Stack Overflow
See other posts from Stack Overflow
or by Chau
Published on 2010-05-31T15:00:23Z
Indexed on
2010/05/31
15:03 UTC
Read the original article
Hit count: 619
I'm trying to create a simple login window with the very common 'Remember me' functionality. The login validation is done AJAX style, thus the browser won't remember my input.
My approach is to use the built-in state
functionality, but how to use it confuses me.
Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now
}));
...
{
xtype: 'textfield',
fieldLabel: 'User name',
id: 'txt-username',
stateful: true,
stateId: 'username'
}, {
xtype: 'textfield',
fieldLabel: 'Password',
id: 'txt-password',
inputType: 'password',
stateful: true,
stateId: 'password'
}, {
xtype: 'button',
text: 'Validate',
stateEvents: 'click'
}
I know I have to implement the getState
method, but on what component (my guess is on the two textfields)? Another thing I fail to realize is, how is my click event on the button connected to the state properties of my textfields?
© Stack Overflow or respective owner