Appmaker-本地数据源与外部数据源/目录之间的关系 [英] Appmaker - Relation between local datasource and external datasource/Directory

查看:75
本文介绍了Appmaker-本地数据源与外部数据源/目录之间的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在本地源(MyStaff)和外部数据源目录(我公司的目录)之间建立关系联接.

Trying to make a relational join between a local source (MyStaff) and the external datasource Directory (my company's directory).

但是,没有关联它们的选项.

However, there isn't an option to relate them.

希望创建一个具有自定义字段的本地数据源,我可以将这些字段附加"到现有Directory数据源中的用户记录.

Was hoping to create a local datasource with custom fields that I can "append" to user records from the existing Directory datasource.

感谢您的帮助.

L.

推荐答案

无法在目录模型和其他模型类型之间创建关系.您至少可以通过三种方法来解决此短缺问题:

There is no way to create relations between Directory Model and other model types. You have at least three ways to workaround this shortage:

一个

动态查询目录记录-可以很好地处理单记录页面,但是对于列表来说太慢了.

Query directory records on the fly - this will okish work for single-record pages, but it will be tooo slow for lists.

两个

您可以在表中复制所需的目录字段.

You can duplicate Directory fields you need in your tables.

优点:

  • 它不会降低您的应用速度
  • 它将使您能够使用混合模型数据(目录+驱动器表或Cloud SQL)实现查询

缺点:

  • 您将在两个不同的位置存储相同的数据
  • 最终,您的目录数据版本会过时

您可以在中找到第二种方法的不错的示例 人际交往应用.

You can find nice sample of the second approach in People Skills app.

三个

按需查询目录数据.假设您有数据绑定列表,并且绑定到列表的记录具有UserEmail字段.在这种情况下,您可以:

Query Directory data on demand. Let's say you have databound list, and records bound to the list have UserEmail field. In this case you can:

  1. 在列表行中添加一些按钮
  2. 在按钮onClick事件处理程序中添加类似于以下代码:

app.datasources.Directory.query.filters.PrimaryEmail._equals = widget.datasource.item.UserEmail;
app.datasources.Directory.load();
app.showPage(app.pages.UserDetails); // or app.showDialog(app.pages.UserDetails);

这篇关于Appmaker-本地数据源与外部数据源/目录之间的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆