如何从另一个UI加载UI(重定向) [英] How to Load a UI from Another UI (Redirection)

查看:134
本文介绍了如何从另一个UI加载UI(重定向)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能正在考虑这种错误的方式......但我有两个使用UiApp构建的不同UI;

第1部分:项目索引用户界面,其中包含所有已批准/待处理项目的列表。


  • 每个项目都有唯一的ID,在另一个与每个ID相关的电子表格中的信息。
  • 4Project Spreadsheet。

    第2部分:项目详细信息UI,它基本上是一个用于编辑电子表格中的值的界面并使用新信息更新日历活动。




    目标是给我的老板索引当前所有的项目在系统中。然后,按照他的意愿,他可以点击一个项目ID来加载另一个用户界面,该用户界面显示该ID的信息。

    所以:I正在考虑将项目名称作为锚点,其中嵌入了ID,例如:

    var anchor = app.createAnchor(Some Project ,https://sites.google.com/site/mySite/asdf&ID=20857);



    其中 asdf 是项目详细信息UI所在的页面。然后,我会解析URL以获取ID,并以这种方式将信息加载到Project Details UI中。






    什么我在想这是方式太复杂了,而且有一个更简单的方法来完成这个,但我不确定。



    有没有更好的方法来生成一个新的UI,其中包含通过原始用户界面中某种链接获得的特定数据?



    解决方案:包含2个标签的 TabPanel - 每个ID均充当对电子表格中的一行信息的引用。当点击一个按钮时,一个 serverHandler 调用一个具有该ID作为参数的函数,该函数用该ID的信息填充第二个选项卡。



    下面是UI的两个例子以及它们应该如何运作:



    解决方案

    如果你已经写过它们,并且不想改变太多,工作好,但它可能会有点慢,因为每个链接点击打开一个新的标签,加载该网站和第二个应用程序脚本,可能会很慢。
    如果你想要更快的东西和更简洁的界面,你应该改变你的代码,这样你可以在第一个中加载第二个gui,例如使用一个stackpanel或者一个列表,当你点击它并放入第二个UI。为此,您需要合并两个项目源。


    I may be thinking about this the wrong way... but I have 2 different UIs built using UiApp;

    Part 1: the "Project Index UI" which holds a list of all approved/pending projects.

    • I have unique IDs for each project, with a row of information in another Spreadsheet that correlates to each ID.

    Example: Project ID 20857 really points to row 4 in "Project Spreadsheet".

    Part 2: the "Project Details UI" which is essentially an interface for editing the values in the Spreadsheet and updating calendar events with the new information.


    The goal is to give my boss an index of all projects that are currently in the system. Then, as he wants, he can click on a project ID to load another UI that presents the information for that ID.

    So: I was thinking about having the Project Name as an anchor, where the ID is embedded such as:

    var anchor = app.createAnchor("Some Project", "https://sites.google.com/site/mySite/asdf&ID=20857");

    Where asdf is the page where the "Project Details UI" is located. Then I would parse the URL to get the ID, and load the information into the Project Details UI that way.


    What I'm thinking is that this is way too complicated, and that there is an easier way to accomplish this but I'm just not sure.

    Is there a better method for generating a new UI with specific data obtained through a "link" of some sort in the original UI?

    Solution: TabPanel with 2 tabs - each ID acts as a reference to a row of information in a Spreadsheet. When a button is clicked, a serverHandler invokes a function with that ID as a parameter, which fills the second tab with information for that ID.

    Below are two illustrations of the UIs and how they should function:

    解决方案

    If you have them written already and dont want to change much, it will work ok but it might be a bit slow, as each link click opens a new tab which loads the site and 2nd apps script which can be slow. If you want something faster and a more streamlined interface you should change your code so you can load the 2nd gui inside the 1st one, for example use a stackpanel or a list that expands when you click it and put inside the 2nd ui. For this you need to merge both projects sources.

    这篇关于如何从另一个UI加载UI(重定向)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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