Appmaker

编程入门 行业动态 更新时间:2024-10-25 16:27:25
本文介绍了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:

  • 在列表行中添加一些按钮
  • 在按钮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

    本文发布于:2023-08-05 21:35:56,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1308195.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:Appmaker

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!