本文整理汇总了Python中pyasm.widget.HiddenWdg.add_attr方法的典型用法代码示例。如果您正苦于以下问题:Python HiddenWdg.add_attr方法的具体用法?Python HiddenWdg.add_attr怎么用?Python HiddenWdg.add_attr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.HiddenWdg
的用法示例。
在下文中一共展示了HiddenWdg.add_attr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.widget import HiddenWdg [as 别名]
# 或者: from pyasm.widget.HiddenWdg import add_attr [as 别名]
#.........这里部分代码省略.........
day_wdg = DivWdg()
day_wdg.add(day)
td = table.add_cell()
td.add_style("width: %spx" % my.day_width)
text = TextWdg('%sday_%s' % (time_prefix, day))
if disabled:
text.set_option('read_only','true')
text.set_attr('disabled','disabled')
td.add(text)
text.add_class('spt_day%s' % (time_prefix))
text.add_styles("width: %spx;text-align: right;padding-left: 2px" %(my.day_width-2))
#text.add_styles("width: 100%;text-align: right;padding-left: 2px")
if day == today:
text.add_style("border: solid 1px black")
else:
text.add_border()
week_day = my.weekday_dict[idx]
if week_day in ['Sat','Sun']:
# MAIN: Overtime, weekend
if row_to_draw == my.OT_ROW:
text.add_color("background", "background2", modifier=[-15,0,5])
else:
text.add_color("background", "background2", modifier= [0,15,20])
text.add_style("margin: 0px 1px")
if row_to_draw == my.OT_ROW:
text.add_attr('input_field_type', 'ot')
else:
text.add_attr('input_field_type', 'st')
if my.kwargs.get('show_all_users')=='true':
text.set_option('read_only','true')
#TODO: while we may have multiple entries per task, we will only use the latest one here
# for now, making the UI cleaner
# if a corresponding entry exists, display its value
entry_list_dict = entries.get(day)
daily_sum = 0
value = 0
entry_list = []
if entry_list_dict:
row_key = my.ROW_DICT.get(row_to_draw)
entry_list = entry_list_dict.get(row_key)
if entry_list:
for entry in entry_list:
# Check if there is something in the category column.
category = entry.get_value("category")
if row_to_draw == my.OT_ROW:
# Skip if the category field does not have a 'ot' indicated.
if not category:
print "Warning this work_hour entry has no category [%s]" % entry.get_code()
continue
# Check if there exist a value in the straight_time column
value, delta = my.get_time_value(entry, row_to_draw)
if value:
示例2: SearchLimitWdg
# 需要导入模块: from pyasm.widget import HiddenWdg [as 别名]
# 或者: from pyasm.widget.HiddenWdg import add_attr [as 别名]
#.........这里部分代码省略.........
if self.style == self.SIMPLE:
showing_wdg.add( current_value )
else:
# add a range selector using ItemsNavigatorWdg
from pyasm.widget import ItemsNavigatorWdg
selector = ItemsNavigatorWdg(self.label, self.count, self.search_limit)
selector.select.add_behavior( {
'type': 'change',
'cbjs_action': self.refresh_script
} )
selector.set_style(self.style)
selector.select.add_style("width: 100px")
#selector.add_style("display: inline")
selector.add_style("float: left")
selector.set_value(current_value)
selector.set_display_label(False)
showing_wdg.add( selector)
showing_wdg.add( next )
showing_wdg.add("<br clear='all'/>")
showing_wdg.add("<br clear='all'/>")
#showing_wdg.add( " x ")
showing_wdg.add(self.text)
self.text.add_style("margin-top: -3px")
self.text.set_attr("size", "1")
self.text.add_attr("title", "Set number of items per page")
# set the limit
set_limit_wdg = self.get_set_limit_wdg()
widget.add(set_limit_wdg)
from tactic.ui.widget.button_new_wdg import ActionButtonWdg
button = ActionButtonWdg(title='Search')
widget.add(button)
button.add_style("float: right")
button.add_style("margin-top: 8px")
button.add_behavior( {
'type': 'click_up',
'cbjs_action': '''
var top = bvr.src_el.getParent(".spt_search_limit_top");
var select = top.getElement(".spt_search_limit_select");
var value = select.value;
if (value == 'Custom') {
custom = top.getElement(".spt_search_limit_custom_text");
value = custom.value;
}
if (value == '') {
value = 20;
}
var text = top.getElement(".spt_search_limit_text");
text.value = value;
spt.dg_table.search_cbk({}, bvr)
'''
} )