我正在为一个学校项目制作一个应用程序。我必须动态地创建一组图像(取决于数据库中的图像数量)。这些映像需要附加一个链接,Applicationcraft中的images有一个属性,但是我无法找到使用它的语法。
我现在有这样的情况:
for (var i = 0; i < data.length; i++)
{
app.createWidget('PanelContainerSponsorLabel', 'WiziCore_UI_LabelWidget', undefined, {name:"HoofdsponsorLabel"+i, pWidth:100, height:50});
app.createWidget('PanelContainerSponsorLabel', 'WiziCore_UI_LabelWidget', undefined, {name:"fillerLabel"+i, label:"", pWidth:100, height:50});
app.createWidget('PanelContainerSponsorImage', 'WiziCore_UI_ImgWidget', undefined, {name:"HoofdsponsorImage"+i, pWidth:100, height:50});
app.createWidget('PanelContainerSponsorImage', 'WiziCore_UI_LabelWidget', undefined, {name:"fillerLabel"+i, label:"", pWidth:100, height:50});
app.setValue("HoofdsponsorLabel"+i, data[i].BI_SponsorNaam);
app.setValue("HoofdsponsorImage"+i, data[i].BI_SponsorImage, {link:{type:"url",title:"http:\/\/www.google.nl\/",body:"new_window"}}); //Link to URL here
}文档没有详细说明如何格式化该属性,也没有收到错误消息,所以我有点卡住了。
发布于 2014-06-14 08:40:21
找到属性名称的最佳方法是在AC属性栏中的相关属性上悬停,或者使用ac的app.debugProperties()函数使用开发工具进行检查。
根据您所说的,我认为您要查找的属性名是img,然后将图像的URL设置为填充。
也请查看AC论坛,已经有许多关于createWidget()的帖子可以帮助您查看craft/searches?query=createwidget&x=0&y=0&style=topics
https://stackoverflow.com/questions/24210370
复制相似问题