#NEWLINE# def __init__( self , layout_handle , index , editor , **kw ) : #NEWLINE# #INDENT# self . editor = editor #NEWLINE# if ( editor . grid_column_template is not None ) : #NEWLINE# #INDENT# self . value_template = editor . grid_column_template #NEWLINE# #UNINDENT# kw . update ( sortable = True ) #NEWLINE# kw . update ( colIndex = index ) #NEWLINE# if editor . hidden : #NEWLINE# #INDENT# kw . update ( hidden = True ) #NEWLINE# #UNINDENT# if settings . SITE . use_filterRow : #NEWLINE# #INDENT# if editor . filter_type : #NEWLINE# #INDENT# if ( index == 0 ) : #NEWLINE# #INDENT# kw . update ( clearFilter = True ) #NEWLINE# #UNINDENT# kw . update ( filterInput = js_code ( 'new Ext.form.TextField()' ) ) #NEWLINE# kw . update ( filterOptions = [ dict ( value = 'empty' , text = 'Is empty' ) , dict ( value = 'notempty' , text = 'Is not empty' ) , dict ( value = 'contains' , text = 'Contains' ) , dict ( value = 'doesnotcontain' , text = 'Does not contain' ) ] ) #NEWLINE# #UNINDENT# #UNINDENT# if ( settings . SITE . use_gridfilters and editor . gridfilters_settings ) : #NEWLINE# #INDENT# if ( isinstance ( editor , FieldElement ) and ( not isinstance ( editor . field , fields . VirtualField ) ) ) : #NEWLINE# #INDENT# kw . update ( filter = editor . gridfilters_settings ) #NEWLINE# #UNINDENT# #UNINDENT# if isinstance ( editor , FieldElement ) : #NEWLINE# #INDENT# if settings . SITE . use_quicktips : #NEWLINE# #INDENT# if settings . SITE . show_internal_field_names : #NEWLINE# #INDENT# ttt = ( '(%s.%s) ' % ( layout_handle . layout . _datasource , self . editor . field . name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ttt = '' #NEWLINE# #UNINDENT# if ( self . editor . field . help_text and ( not ( '<' in self . editor . field . help_text ) ) ) : #NEWLINE# #INDENT# ttt = string_concat ( ttt , self . editor . field . help_text ) #NEWLINE# #UNINDENT# if ttt : #NEWLINE# #INDENT# kw . update ( tooltip = ttt ) #NEWLINE# #UNINDENT# #UNINDENT# def fk_renderer( fld , name ) : #NEWLINE# #INDENT# rpt = fld . rel . model . get_default_table ( ) #NEWLINE# if ( rpt . detail_action is not None ) : #NEWLINE# #INDENT# if rpt . detail_action . get_view_permission ( jsgen . _for_user_profile ) : #NEWLINE# #INDENT# return ( "Lino.fk_renderer('%s','Lino.%s')" % ( ( name + constants . CHOICES_HIDDEN_SUFFIX ) , rpt . detail_action . full_name ( ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# rend = None #NEWLINE# if has_fk_renderer ( editor . field ) : #NEWLINE# #INDENT# rend = fk_renderer ( editor . field , editor . field . name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( editor . field , fields . VirtualField ) : #NEWLINE# #INDENT# kw . update ( sortable = False ) #NEWLINE# if has_fk_renderer ( editor . field . return_type ) : #NEWLINE# #INDENT# rend = fk_renderer ( editor . field . return_type , editor . field . name ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if rend : #NEWLINE# #INDENT# kw . update ( renderer = js_code ( rend ) ) #NEWLINE# #UNINDENT# kw . update ( editable = editor . editable ) #NEWLINE# if ( editor . editable and ( not isinstance ( editor , BooleanFieldElement ) ) ) : #NEWLINE# #INDENT# kw . update ( editor = editor ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# kw . update ( editable = False ) #NEWLINE# #UNINDENT# kw . update ( editor . get_column_options ( ) ) #NEWLINE# jsgen . Component . __init__ ( self , kw . name , ** kw )