本文整理汇总了Python中pyasm.widget.HiddenWdg.set_options方法的典型用法代码示例。如果您正苦于以下问题:Python HiddenWdg.set_options方法的具体用法?Python HiddenWdg.set_options怎么用?Python HiddenWdg.set_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.HiddenWdg
的用法示例。
在下文中一共展示了HiddenWdg.set_options方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.widget import HiddenWdg [as 别名]
# 或者: from pyasm.widget.HiddenWdg import set_options [as 别名]
def get_display(self):
top = DivWdg()
top.add_class("ad_input_top")
name = self.get_name()
text = TextWdg(self.get_input_name())
# get the login
sobject = self.get_current_sobject()
client = sobject.get_value("contact_name")
print "client: ", client
if client:
login_sobj = Login.get_by_code(client)
else:
login_sobj = Environment.get_login()
# build the display_name
login = login_sobj.get_value("login")
display_name = login_sobj.get_value("display_name")
if not display_name:
display_name = "%s %s" % (user.get('first_name'), user.get('last_name'))
display_name = display_name.replace('"', "'")
print "login: ", login
hidden = HiddenWdg(self.get_input_name())
hidden.set_options( self.options.copy() )
hidden.add_class("spt_ad_input")
if login:
hidden.set_value(login)
top.add(hidden)
# copy over some options
#text.set_options( self.options.copy() )
if login:
text.set_value(display_name)
text.set_option("read_only", "true")
text.add_class("spt_ad_display")
top.add(text)
top.add(" ")
groups_str = self.get_option("groups_allowed_to_search")
if groups_str:
stmt = 'groups_list = %s' % groups_str
exec stmt
else:
groups_list = None
allow_search = True
if groups_list:
allow_search = False
login_in_group_list = Search.eval("@SOBJECT(sthpw/login_in_group['login','=','%s'])" % login)
for login_in_group in login_in_group_list:
group = login_in_group.get_value("login_group")
if group in groups_list:
allow_search = True
break
if login == 'admin':
allow_search = True
if allow_search:
button = IconButtonWdg('Search for User', IconWdg.USER)
#button = ButtonWdg()
button.add_behavior( {
'type': 'click_up',
'cbjs_action': '''
var top = bvr.src_el.getParent('.ad_input_top');
var content = top.getElement('.ad_input_content');
spt.toggle_show_hide(content);
'''
} )
top.add(button)
ad_top = DivWdg()
ad_top.add_class("ad_input_content")
ad_top.add_style("display: none")
ad_top.add_style("position: absolute")
ad_top.add_style("background: #222")
ad_top.add_style("min-width: 300px")
ad_top.add_style("border: solid 1px #000")
ad_top.add_style("padding: 20px")
cbjs_action = '''
var value = bvr.src_el.getAttribute('spt_input_value');
var display_value = bvr.src_el.getAttribute('spt_display_value');
var phone_number = bvr.src_el.getAttribute('spt_phone_number');
var email = bvr.src_el.getAttribute('spt_mail');
var top = bvr.src_el.getParent('.ad_input_top');
#.........这里部分代码省略.........