如何在AppMaker表字段中包含关系的关系? [英] How to include a relation of a relation in an AppMaker table field?
问题描述
我有三个数据模型,Partner,Client和SOW,其中Client是与SOW的一对多关系,Partner是与Client的一对多关系.我想在显示SOW的表中将合作伙伴名称"作为一列包括在内.有没有办法使用数据源查询脚本来做到这一点?还是完全不同的方法? 我能够向SOW表行添加一个标签,该标签是通过关系绑定到合作伙伴名称的数据,但是我还没有解决合作伙伴的排序和过滤问题,该方法似乎在加载表后实时获取合作伙伴.我目前正在使用驱动器表"作为数据源,但是愿意切换到Cloud SQL.
I have three data models, Partner, Client and SOW, where Client is a one-to-many relation to SOW, and Partner is a one-to-many relation to Client. I would like to include Partner Name as a column in a table displaying SOWs. Is there a way to do this with a datasource query script? Or a different approach altogether? I was able to add a label to the SOW table row that is data bound to the Partner name via relation, but I have yet to tackle sorting and filtering by Partner, and this method appears to fetch Partner real-time after the table loads. I am currently using Drive Tables as my datasource, but am open to switching to Cloud SQL.
推荐答案
您可以手动添加标头和单元格"(列表行中还有一个标签).
You can manually add header and 'cell'(one more label in list row).
绑定标题中的标签:
@models.Partner.fields.Name.displayName
绑定列表行中的标签:
@datasource.item.Client.Partner.Name
并且不要忘记将Client
和Client.Partner
关系都添加到预取,它将使您的页面加载/渲染速度更快.
And don't forget to add both Client
and Client.Partner
relations to Prefetch, it should make your page load/render faster.
有用的提示:
您可以复制/粘贴现有表格标签,以复制所有原始页边距/填充/样式,并使它们的外观/行为与表格中所有其他标签相同.在这种情况下,您只需要调整绑定并重命名一些内容即可.
You can copy/paste existing table labels to duplicate all original margins/paddings/styles and make them look/behave in the same way as all other labels within the table. In this case you'll need just to adjust your bindings and maybe rename some things.
注意:
您很可能无法按关系对表进行排序,但可以尝试一下(在表头中签出onClick
标签事件处理程序).
Most likely you'll not be able to sort your table by relation of relation, but feel free to try(checkout onClick
event handlers of labels in the table header).
这篇关于如何在AppMaker表字段中包含关系的关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!