parameters: (self)
return_statement: return div
docstring: parent_div = DivWdg()
          div.add(parent_div)
  
          select = SelectWdg("value")
          parent_div.add(select)
          select.add_style("width: 150px")
          select.add_color("background", "background")
  
          value = self.values.get("value")
          if value:
              select.set_option("values", [value])
              select.set_value(value)
  
          select.add_empty_option("-- Select --")
  
          select.add_behavior( {
              'type': 'mouseover',
              'kwargs': self.kwargs,
              'cbjs_action': '''
              var top = bvr.src_el.getParent();
              var class_name = 'tactic.ui.filter.ReplaceSelectWdg';
              spt.panel.load( top, class_name, bvr.kwargs);
              '''
          } )
docstring_summary: parent_div = DivWdg()
          div.add(parent_div)
docstring_tokens: parent_div = DivWdg () div . add ( parent_div )
function: def get_display(self):
  
          div = DivWdg()
          div.add_style("display: flex")
          #div.add_style("width: 350px")
  
          select = SelectWdg("value")
          select.add_style("width: 190px")
  
          default_value = self.kwargs.get("default")
  
          # TODO: this is needed for multiple selection, but it is ugly
          #select.set_attr("multiple", "1")
          #select.add_attr("spt_is_multiple", "true")
          # if there is a link search already, don't use default
          if self.values and self.kwargs.get('default'):
              self.kwargs.pop('default')
  
          select.set_options(self.kwargs)
          select.add_empty_option("-- Select --")
          name = self.get_name()
  
          select.add_behavior( {
              'type': 'change',
              'element_name': name,
              'cbjs_action': self.get_set_js_action()
          } )
  
          # this is needed so they don't cross contaminate
          # FIXME: this is probably a bug in SelectWdg
          select.set_value('')
          value = self.values.get("value")
          if not value:
              value = default_value
  
          if value:
              select.set_value(value)
  
          if self.show_title:
              title_div = DivWdg()
              div.add(title_div)
              title_div.add_style("float: left")
  
              name = self.get_name()
  
              title = self.get_title()
              if not title:
                  title = name
                  title = Common.get_display_title(title)
              title_div.add("%s:" % title )
              title_div.add_style("width: 80px")
              title_div.add_style("font-weight: bold")
              title_div.add_style("margin-left: 15px")
              title_div.add_style("padding-top: 2px")
  
          op = self.kwargs.get("op")
          if op == 'exists':
              div.add("&nbsp;&nbsp;&nbsp;is&nbsp;&nbsp;&nbsp;")
              div.add(HiddenWdg("op", "exists"))
          elif op == 'is on':
              div.add("&nbsp;&nbsp;&nbsp;is on&nbsp;&nbsp;&nbsp;")
              div.add(HiddenWdg("op", "is on"))
          elif op in ['~', 'contains']:
              div.add("&nbsp;&nbsp;&nbsp;contains&nbsp;&nbsp;&nbsp;")
              div.add(HiddenWdg("op", "~"))
          elif op == 'is':
              #TODO: have this style apply to everything else and get rid of &nbsps
              op_div = DivWdg('is')
              op_div.add_styles('margin-top: 8px; margin-right: 15px')
              div.add(op_div)
              div.add(HiddenWdg("op", "="))
              div.add_style("display: flex")
          else:
              op_select = SelectWdg("op")
              op_select.add_style("width: 100px")
              # only support in or not in for multi stypes column
              if self.multi_search_types:
                  op_select.set_option("labels", "is|is not")
                  op_select.set_option("values", "=|!=")
              else:
                  op_select.set_option("labels", "is|is not|contains|is empty")
                  op_select.set_option("values", "=|!=|~|is empty")
  
              value = self.values.get("op")
              if value:
                  op_select.set_value(value)
  
              div.add(op_select)
              op_select.add_style("float: left")
              op_select.add_style("margin-right: 3px")
  
          div.add(select)
  
          # TEST Dynamic loading of select widget
          # Disabling: delay is too long.
          """
          parent_div = DivWdg()
          div.add(parent_div)
  
          select = SelectWdg("value")
          parent_div.add(select)
          select.add_style("width: 150px")
          select.add_color("background", "background")
  
          value = self.values.get("value")
          if value:
              select.set_option("values", [value])
              select.set_value(value)
  
          select.add_empty_option("-- Select --")
  
          select.add_behavior( {
              'type': 'mouseover',
              'kwargs': self.kwargs,
              'cbjs_action': '''
              var top = bvr.src_el.getParent();
              var class_name = 'tactic.ui.filter.ReplaceSelectWdg';
              spt.panel.load( top, class_name, bvr.kwargs);
              '''
          } )
          """
  
          return div
function_tokens: def get_display ( self ) : div = DivWdg ( ) div . add_style ( "display: flex" ) #div.add_style("width: 350px") select = SelectWdg ( "value" ) select . add_style ( "width: 190px" ) default_value = self . kwargs . get ( "default" ) # TODO: this is needed for multiple selection, but it is ugly #select.set_attr("multiple", "1") #select.add_attr("spt_is_multiple", "true") # if there is a link search already, don't use default if self . values and self . kwargs . get ( 'default' ) : self . kwargs . pop ( 'default' ) select . set_options ( self . kwargs ) select . add_empty_option ( "-- Select --" ) name = self . get_name ( ) select . add_behavior ( { 'type' : 'change' , 'element_name' : name , 'cbjs_action' : self . get_set_js_action ( ) } ) # this is needed so they don't cross contaminate # FIXME: this is probably a bug in SelectWdg select . set_value ( '' ) value = self . values . get ( "value" ) if not value : value = default_value if value : select . set_value ( value ) if self . show_title : title_div = DivWdg ( ) div . add ( title_div ) title_div . add_style ( "float: left" ) name = self . get_name ( ) title = self . get_title ( ) if not title : title = name title = Common . get_display_title ( title ) title_div . add ( "%s:" % title ) title_div . add_style ( "width: 80px" ) title_div . add_style ( "font-weight: bold" ) title_div . add_style ( "margin-left: 15px" ) title_div . add_style ( "padding-top: 2px" ) op = self . kwargs . get ( "op" ) if op == 'exists' : div . add ( "&nbsp;&nbsp;&nbsp;is&nbsp;&nbsp;&nbsp;" ) div . add ( HiddenWdg ( "op" , "exists" ) ) elif op == 'is on' : div . add ( "&nbsp;&nbsp;&nbsp;is on&nbsp;&nbsp;&nbsp;" ) div . add ( HiddenWdg ( "op" , "is on" ) ) elif op in [ '~' , 'contains' ] : div . add ( "&nbsp;&nbsp;&nbsp;contains&nbsp;&nbsp;&nbsp;" ) div . add ( HiddenWdg ( "op" , "~" ) ) elif op == 'is' : #TODO: have this style apply to everything else and get rid of &nbsps op_div = DivWdg ( 'is' ) op_div . add_styles ( 'margin-top: 8px; margin-right: 15px' ) div . add ( op_div ) div . add ( HiddenWdg ( "op" , "=" ) ) div . add_style ( "display: flex" ) else : op_select = SelectWdg ( "op" ) op_select . add_style ( "width: 100px" ) # only support in or not in for multi stypes column if self . multi_search_types : op_select . set_option ( "labels" , "is|is not" ) op_select . set_option ( "values" , "=|!=" ) else : op_select . set_option ( "labels" , "is|is not|contains|is empty" ) op_select . set_option ( "values" , "=|!=|~|is empty" ) value = self . values . get ( "op" ) if value : op_select . set_value ( value ) div . add ( op_select ) op_select . add_style ( "float: left" ) op_select . add_style ( "margin-right: 3px" ) div . add ( select ) # TEST Dynamic loading of select widget # Disabling: delay is too long. return div