[python学习笔记]设置单据体字段字体颜色(前景色)
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.BOS.DataEntity')
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
from Kingdee.BOS.Orm.DataEntity import *
def AfterBindData(e):
entity = this.View.BillBusinessInfo.GetEntity('FEntity') # FEntity 为单据体标识
objCollection =this.View.Model.GetEntityDataObject(entity)
grid =this.View.GetControl('FEntity')
for index in range(len(objCollection)):
obj = objCollection[index]
valDebit = obj["Score"]
if valDebit is not None :
grid.SetForecolor("FScore","#FF0000", index);#需要设置字段标识Key
clr.AddReference('Kingdee.BOS.DataEntity')
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
from Kingdee.BOS.Orm.DataEntity import *
def AfterBindData(e):
entity = this.View.BillBusinessInfo.GetEntity('FEntity') # FEntity 为单据体标识
objCollection =this.View.Model.GetEntityDataObject(entity)
grid =this.View.GetControl('FEntity')
for index in range(len(objCollection)):
obj = objCollection[index]
valDebit = obj["Score"]
if valDebit is not None :
grid.SetForecolor("FScore","#FF0000", index);#需要设置字段标识Key
效果如图:
特别注意,python非常注意缩进,一定记得保持缩进!!!
不是设置单据体的颜色,是要设置单据体字段标题的颜色
背景色同理,只需要把最后一行改成j即可:
grid.SetBackcolor("FScore","#FFFF00", index);#需要设置字段标识Key
效果如图:
[python学习笔记]设置单据体字段字体颜色(前景色)
clr.AddReference('Kingdee.BOS.Core')clr.AddReference('Kingdee.BOS.DataEntity')from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlMod...
点击下载文档
本文2024-09-16 17:19:18发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-14950.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章