def get_display(self):
    mode = self.get_option('mode')
    if (not mode):
        mode = 'text'
    if (mode not in ['select', 'text']):
        class_name = self.__class__.__name__
        raise TacticException(("%s mode option can only be 'select' or 'text'." % class_name))
    field_size = self.get_option('field_size')
    div = SpanWdg()
    if (mode == 'text'):
        kwargs = {'name': 'field', 'search_type': self.get_option('search_type'), 'column': self.get_option('display_column'), 'value_column': self.get_option('value_column')}
        if self.get_option('search_type'):
            text = LookAheadTextInputWdg(**kwargs)
            text.set_name('field')
        else:
            text = TextInputWdg(name='field')
        if field_size:
            text.add_attr('size', field_size)
        div.add(text)
        text.add_behavior({'type': 'keyup', 'cbjs_action': "\n            var key = evt.key;\n            if (key == 'enter') {\n                spt.dg_table.search_cbk( {}, {src_el: bvr.src_el} );\n            }\n            "})
    elif (mode == 'select'):
        values = self.get_option('select_values')
        labels = self.get_option('select_labels')
        select = SelectWdg('field')
        select.add_empty_option('-- Select --')
        select.set_option('values', values)
        select.set_option('labels', labels)
        div.add(select)
    mod_value = self.get_option('last_modified_days')
    if mod_value:
        select = SelectWdg('last_modified', label='modified in: ')
        if (mod_value == 'true'):
            mod_value = '10|20|30|60|90'
        mod_values = mod_value.split('|')
        mod_values = [x.strip() for x in mod_values]
        mod_labels = [('last %s Days' % x) for x in mod_values]
        select.add_empty_option('-- Select --')
        select.set_option('values', mod_values)
        select.set_option('labels', mod_labels)
        div.add(select)
    return div
def get_display(self):
    mode = self.get_option('mode')
    if (not mode):
        mode = 'text'
    if (mode not in ['select', 'text']):
        class_name = self.__class__.__name__
        raise TacticException(("%s mode option can only be 'select' or 'text'." % class_name))
    field_size = self.get_option('field_size')
    div = SpanWdg()
    if (mode == 'text'):
        kwargs = {'name': 'field', 'search_type': self.get_option('search_type'), 'column': self.get_option('display_column'), 'value_column': self.get_option('value_column')}
        if self.get_option('search_type'):
            text = LookAheadTextInputWdg(**kwargs)
            text.set_name('field')
        else:
            text = TextInputWdg(name='field')
        if field_size:
            text.add_attr('size', field_size)
        div.add(text)
        text.add_behavior({'type': 'keyup', 'cbjs_action': "\n            var key = evt.key;\n            if (key == 'enter') {\n                spt.dg_table.search_cbk( {}, {src_el: bvr.src_el} );\n            }\n            "})
    elif (mode == 'select'):
        values = self.get_option('select_values')
        labels = self.get_option('select_labels')
        select = SelectWdg('field')
        select.add_empty_option('-- Select --')
        select.set_option('values', values)
        select.set_option('labels', labels)
        div.add(select)
    mod_value = self.get_option('last_modified_days')
    if mod_value:
        select = SelectWdg('last_modified', label='modified in: ')
        if (mod_value == 'true'):
            mod_value = '10|20|30|60|90'
        mod_values = mod_value.split('|')
        mod_values = [x.strip() for x in mod_values]
        mod_labels = [('last %s Days' % x) for x in mod_values]
        select.add_empty_option('-- Select --')
        select.set_option('values', mod_values)
        select.set_option('labels', mod_labels)
        div.add(select)
    return div