Skip to content
Snippets Groups Projects
Commit 8532cd66 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Improve the model to run likedComboBox with translated values and

pre-defined order.
parent af1c8380
No related branches found
No related tags found
No related merge requests found
......@@ -64,16 +64,19 @@
'Type': 'Type',
'Volume': 'Volume',
'Year': 'Année',
'agency': 'agence',
'bla bla...': 'bla bla...',
'blab blab ....': 'blab blab ....',
'categories': 'catégories',
'collaborations': 'collaborations',
'countries': 'pays',
'domain': 'domaine',
'enter a number between %(min)g and %(max)g': 'enter a number between %(min)g and %(max)g',
'enter an integer between %(min)g and %(max)g': 'enter an integer between %(min)g and %(max)g',
'enter an integer greater than or equal to %(min)g': 'enter an integer greater than or equal to %(min)g',
'harvesters': 'harvesters',
'plugin not install': 'plugin not install',
'project': 'projet',
'projects': 'projets',
'publications': 'publications',
'publishers': 'éditeur',
......@@ -88,9 +91,12 @@
'select publications with a given AERES code': 'selectionne les publications avec un code AERES',
'select publications with a given category code': 'select publications with a given category code',
'select...': 'select...',
'team': 'équipe',
'teams': 'équipes',
'time': 'temps',
'undefined': 'indéfini',
'unknown': 'unknown',
'url': 'url',
'value already in database or empty': 'value already in database or empty',
'year': 'année',
}
......@@ -28,14 +28,14 @@ fieldsModifier.merge_fields('conference_start',
#
fieldsModifier = dbui.FieldsModifier('foo1')
fieldsModifier.configure_field('my_axis',
displayField='axis',
displayField='axis_local',
role='master',
store='axesStore',
valueField='axis',
xtype='xlinkedcombobox')
fieldsModifier.configure_field('my_granularity',
displayField='granularity',
displayField='granularity_local',
mode='local',
role='slave',
store='axesStore',
......
......@@ -5,12 +5,12 @@
#
# Create a static store with the axes definition
#
cfg = dbui.ArrayStore(fields=['axis', 'granularity'],
data=[['projects', 'agency'],
['projects', 'project'],
['teams', 'domain'],
['teams', 'team'],
['time', 'year']])
cfg = dbui.ArrayStore(fields=['axis', 'axis_local', 'granularity', 'granularity_local'],
data=[['projects', T('projects'), 'project', T('project')],
['projects', T('projects'), 'agency', T('agency')],
['teams', T('teams'), 'team', T('team')],
['teams', T('teams'), 'domain', T('domain')],
['time', T('time'), 'year', T('year')]])
dbui.AddStore('axes', **cfg)
#
......
......@@ -6,8 +6,8 @@
* The design is based on a master and a slave combobox which are
* linked to a common store.
*
* The master shows the values which are used to filter the common store.
* Values are unique and sorted in alphabetic order.
* The master is a standard combobox showing the values used to filter
* the common store. Values are unique and never change.
* The properties role, store, displayField and valueField have to be defined.
*
* A slave is a standard combobox.
......@@ -31,6 +31,7 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, {
/**
* private properties
* {Ext.data.Store} masterStore the common store shared by the master and slaves
*/
masterStore: null,
......@@ -59,7 +60,6 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, {
}
// configuration parameters common to master and slave
this.store.sort(this.dispayField);
this.triggerAction = 'all';
// construct the underlying class. DON'T MOVE
......
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