本文整理汇总了Python中pyasm.widget.SelectWdg.remove_empty_option方法的典型用法代码示例。如果您正苦于以下问题:Python SelectWdg.remove_empty_option方法的具体用法?Python SelectWdg.remove_empty_option怎么用?Python SelectWdg.remove_empty_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.SelectWdg
的用法示例。
在下文中一共展示了SelectWdg.remove_empty_option方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import remove_empty_option [as 别名]
def get_display(my):
# if no filters are defined, then display nothing
if not my.filters:
return Widget()
#filter_top = DivWdg(css="maq_search_bar")
filter_top = DivWdg()
filter_top.add_color("color", "color")
filter_top.add_color("background", "background", -5)
filter_top.add_style("padding: 5px")
filter_top.add_style("min-width: 700px")
filter_top.add_border()
my.set_as_panel(filter_top)
# TEST link to help for search widget
help_button = ActionButtonWdg(title="?", tip="Search Documentation", size='small')
filter_top.add(help_button)
help_button.add_behavior( {
'type': 'click_up',
'cbjs_action': '''
spt.help.set_top();
spt.help.load_alias("search-quickstart|what-is-searching|search-interface|search-compound|search-expressions");
'''
} )
help_button.add_style("float: right")
# this id should be removed
filter_top.set_id("%s_search" % my.prefix)
filter_top.add_class("spt_search")
for name, value in my.kwargs.items():
filter_top.set_attr("spt_%s" % name, value)
#filter_top.add(my.statement)
popup = my.get_retrieve_wdg()
filter_top.add(popup)
popup = my.get_save_wdg()
filter_top.add(popup)
display = my.kwargs.get('display')
# Add a number of filters indicator
div = DivWdg()
div.add_class("spt_search_num_filters")
div.add_style("float: right")
div.add_style("font-size: 0.9em")
div.add_style("margin: 0 10 0 10")
#search_summary.add(div)
filter_top.add(div)
if my.num_filters_enabled:
msg = "[%s] filter/s" % my.num_filters_enabled
icon = IconWdg(msg, IconWdg.DOT_GREEN)
div.add(icon)
div.add("%s" % msg)
filter_div = DivWdg()
filter_div.set_id("search_filters")
filter_div.add_class("spt_search_filters")
# TODO: disabling for now
# add the action buttons
#action_wdg = my.get_action_wdg()
#action_wdg.add_style("text-align: right")
#filter_div.add( action_wdg )
# add the top
display_str = 'block'
if not display:
display_str = 'none'
filter_div.add_style("display: %s" % display_str)
search_wdg = my.get_search_wdg()
prefix = "filter_mode"
if my.prefix_namespace:
prefix = '%s_%s' %(my.prefix_namespace, prefix)
hidden = HiddenWdg("prefix", prefix)
match_div = DivWdg()
match_div.add(hidden)
match_div.add_class('spt_search_filter')
palette = match_div.get_palette()
bg_color = palette.color('background')
light_bg_color = palette.color('background', modifier=+10)
select = SelectWdg("filter_mode")
select.add_class("spt_search_filter_mode")
select.set_persist_on_submit(prefix)
select.remove_empty_option()
# for Local search, leave out compound search for now
if my.kwargs.get('prefix_namespace'):
select.set_option("labels", "Match all|Match any")
#.........这里部分代码省略.........