ui_graphs.py 2.49 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
# -*- coding: utf-8 -*-
""" graphs

"""
#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
#
#-------------------------------------------------------------------------------
fieldsModifier = dbui.FieldsModifier('graphs')

fieldsModifier.configure_field('definition', height=100)

fieldsModifier.configure_field('stack_axis', flex=1)
fieldsModifier.configure_field('stack_granularity', flex=1)
fieldsModifier.merge_fields('stack_axis', 'stack_granularity', fieldLabel=T('Stack'))

fieldsModifier.configure_field('stack_axis', 
                               itemId='stack_axis',
                               displayField='AxesTr_axis',
                               valueField='AxesAxis',
                               refStore=dbui.get_store_id('axes'),
                               emptyText=T('Select axis...'),
                               userReset=True,
                               xtype='xcomboboxmaster')
 
fieldsModifier.configure_field('stack_granularity', 
                               masterItemId='stack_axis',
                               masterValueField='AxesAxis',
                               displayField='AxesTr_granularity',
                               valueField='AxesGranularity',
                               refStore=dbui.get_store_id('axes'),
                               emptyText=T('Select granularity...'),
                               xtype='xcomboboxslave')

#-------------------------------------------------------------------------------
#
# FORM CONFIGURATiON
#
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#
# GRID CONFIGURATiON
#
#-------------------------------------------------------------------------------
gridModifier = dbui.GridModifier('graphs')

gridModifier.configure_column('graph', width=90)
gridModifier.configure_column('definition', width=250)
gridModifier.hide_columns('stack_axis',
                          'stack_granularity')

gridModifier.append_filter(('graph', 'contains', T('contains')))
gridModifier.configure_filters(plugins=['pFormToolTip'], width=300)
gridModifier.configure_gridWithFilter(selectorTitle= T('Filter'))

#-------------------------------------------------------------------------------
#
# STORE CONFIGURATiON
#
#-------------------------------------------------------------------------------
storeModifier = dbui.StoreModifier('graphs')
storeModifier.orderby(db.graphs.graph)