[python学习笔记]设置单据体字段字体颜色(前景色)原创
11人赞赏了该文章
2,215次浏览
编辑于2022年01月18日 16:27:04
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非常注意缩进,一定记得保持缩进!!!
赞 11
11人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!