Skip to content
Snippets Groups Projects
Commit 51ac04af authored by Renaud Le Gac's avatar Renaud Le Gac
Browse files

press return is not need anymore on texfield.

just type the value and wait.
parent 8ec1ab45
No related branches found
No related tags found
No related merge requests found
...@@ -38,8 +38,12 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { ...@@ -38,8 +38,12 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, {
/** /**
* Predefined setting * Predefined setting
*
* NOTE:
* the enableKeyEvents is mandatory for Ext.form.TextField
*/ */
defaults: {anchor: '100%'}, defaults: {anchor: '100%',
enableKeyEvents: true},
/** /**
* private method requests by the component model of Ext JS * private method requests by the component model of Ext JS
...@@ -54,13 +58,14 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { ...@@ -54,13 +58,14 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, {
for (var i = 0; i < fields.length; i++){ for (var i = 0; i < fields.length; i++){
field = fields[i]; field = fields[i];
// catch a change of value for combo box // catch a change of value for combobox
if (field.xtype == 'xcombobox') if (field.xtype == 'xcombobox')
field.on('select', this.onComboSelect, this); field.on('select', this.onChange, this);
// catch the key pressed enter for other fields // catch the key pressed enter for other fields
// wait that user finish to type to run the handler
else else
field.on('specialkey', this.onKeyPressedEnter, this); field.on('keyup', this.onChange, this, {buffer: 500});
} }
}, },
...@@ -85,22 +90,12 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { ...@@ -85,22 +90,12 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, {
}, },
/** /**
* Handler to catch a new selection in combobox * Handler to catch a change in field value
*/ */
onComboSelect: function(combo, record, index){ onChange: function(field){
this.setupCondition(combo); this.setupCondition(field);
}, },
/**
* Handler to catch the ENTER
* @param {Object} field
* @param {Object} e
*/
onKeyPressedEnter: function(field, e){
if (e.getKey() == e.ENTER)
this.setupCondition(field);
},
/** /**
* Handler to reset the filter * Handler to reset the filter
*/ */
...@@ -145,7 +140,7 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, { ...@@ -145,7 +140,7 @@ App.grid.GridFilter = Ext.extend(Ext.form.FieldSet, {
conditions.push(this.filterConditions[k]); conditions.push(this.filterConditions[k]);
} }
// push new condtion in the where clause of the store // push new condition in the where clause of the store
this.store.baseParams.where = conditions; this.store.baseParams.where = conditions;
// update the store // update the store
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment