PDA

View Full Version : TexxtField state is not working



alexaung
9 Mar 2011, 2:40 AM
Hi All,

I have one search page and want to store all search criteria in state. but i am facing problem with textfield. I already set the stateful, stateId, stateEvents, getState and applyState but it does not work. Please let me know is there any config i missed out. thanks.



Ext.state.Manager.setProvider(new Ext.state.CookieProvider(
{
expires: new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 7))
}));



{
xtype: 'textfield',
fieldLabel: 'Staff ID',
id: 'fieldstaffID',
name: 'staffID',
anchor: '95%',
stateful: true,
stateId: 'fieldstaffID',
stateEvents: ['blur', 'focus', 'keydown', 'keypress', 'keyup', 'change'],
getState: function () { return this.getValue(); },

applyState: function (state) { this.setValue(state); }
}