diff --git a/languages/fr-fr.py b/languages/fr-fr.py index 04bb98ebe2901dc8b99a9cdade7af71fe043aabe..e492c7dedf7a2c9519d0c4cbf376aee8302d4194 100644 --- a/languages/fr-fr.py +++ b/languages/fr-fr.py @@ -35,8 +35,11 @@ 'Id': 'Id', 'Last Page': 'Dernière Page', 'Max Records': 'Max Records', +'My Axes': 'My Axes', +'My Axis': 'My Axis', 'My Date': 'My Date', 'My Format': 'My Format', +'My Granularity': 'My Granularity', 'My Int': 'My Int', 'My List': 'My List', 'My String': 'My String', diff --git a/models/widgets_fields.py b/models/widgets_fields.py index c0a927a1061448cd24983d80811329d58b40b789..87c03bb319bbf667635954f1f6d656eb29f6f04a 100755 --- a/models/widgets_fields.py +++ b/models/widgets_fields.py @@ -32,11 +32,11 @@ fieldsModifier.configure_field('my_axis', mode='local', store='axesStore', valueField='axis', - xtype='xcombobox') + xtype='xfilterbox') fieldsModifier.configure_field('my_granularity', displayField='granularity', mode='local', store='axesStore', valueField='granularity', - xtype='xcombobox') + xtype='xfilterbox') diff --git a/static/plugin_dbui/src/appfilterbox.js b/static/plugin_dbui/src/appfilterbox.js new file mode 100644 index 0000000000000000000000000000000000000000..b484d07b67e7366070e73c39c2f8796643cd21dd --- /dev/null +++ b/static/plugin_dbui/src/appfilterbox.js @@ -0,0 +1,32 @@ +/** + * combobox setup to filter the content of its local store + * + * @extends Ext.form.ComboBox + * + */ +Ext.namespace('App.form'); + +App.form.FilterBox = Ext.extend(App.form.ComboBox, { + + /** + * private method require by the ExtJS component model + */ + initComponent: function () { + + // construct the underlying class. DON'T MOVE + App.form.FilterBox.superclass.initComponent.call(this); + + //logic to filter the content of the store to the combobox value + this.on('select', this.onChange, this); + + }, + + /** + * Handler to catch a change in field value anf to filter the store + */ + onChange: function (combo, record, index) { + this.store.filter(this.displayField, combo.getValue()); + } +}); + +Ext.reg('xfilterbox', App.form.FilterBox);