多按钮风格模型
金蝶云社区-yaojunsong
yaojunsong
3人赞赏了该文章 2,722次浏览 未经作者许可,禁止转载编辑于2016年06月07日 18:01:36

多按钮风格模型


代码:
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *

def AfterBindData(e):
this.View.GetControl("FBLUE").SetStyleKey("BluePureRightAngleButtonStyle")
this.View.GetControl("FORANGE").SetStyleKey("OrangePureRightAngleButtonStyle")
this.View.GetControl("FBLACK").SetStyleKey("BlackPureRightAngleButtonStyle")

this.View.GetControl("FSHOPCAR").SetStyleKey("TextIconWithMsgButtonStyle")
this.View.GetControl("FSHOPCAR").SetViceText("300")
this.View.GetControl("FSHOPCAR").SetTextIcon("images/biz/default/Common/ShopcarBig.png")

this.View.GetControl("FSHOPCAR1").SetStyleKey("TextIconWithMsgButtonStyle")
this.View.GetControl("FSHOPCAR1").SetViceText("9")
this.View.GetControl("FSHOPCAR1").SetTextIcon("images/biz/default/Common/AddFavor.png")

this.View.GetControl("FCOLLECT").SetStyleKey("FavorBlackPureRightAngleButtonStyle")

def ButtonClick(e):
if(e.Key=="FSHOPCAR"):
this.View.GetControl("FSHOPCAR").SetViceText("302")
this.View.GetControl("FSHOPCAR").SetTextIcon("images/biz/default/Common/AddFavor.png")

图片格式的按钮


[tr][td]

为客户门户增加了图片格式的按钮,其他一些个别性的按钮都自己做图片搞了。


任意设置按钮的图片,但会覆盖文字。插件这么写就好。

this.View.GetControl("FBUTTON").SetStyleKey("OrangeButton")
这句话实现 橙色风格的按钮

代码:

from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *

def AfterBindData(e):
#this.View.AddAction('ShowWatcher',None) #这句话显示HTTPWatch
#this.View.GetControl("FBUTTON").SetStyleKey("OrangeButton")
this.View.GetControl("FBUTTON").SetImageUrl("images/silverlight/default/2.0/blockmode.png")
this.View.GetControl("FBUTTON1").SetImageUrl("images/silverlight/default/2.0/linemode.png")

def ButtonClick(e):
this.View.GetControl("FBUTTON").SetImageUrl("images/silverlight/default/2.0/blockmode.png")
this.View.GetControl("FBUTTON1").SetImageUrl("images/silverlight/default/2.0/linemode.png")