gpt4 book ai didi

extjs - Sencha Touch 2 - 执行顺序

转载 作者:行者123 更新时间:2023-12-04 18:44:22 26 4
gpt4 key购买 nike

有谁知道或知道有关函数执行顺序的文章
在 Sencha 触摸 2 中?我认为这会帮助我们,初学者,知道在哪里放置我们的代码。

所以我想知道,从 Controller /模型/ View 中自动调用哪些函数,以及何时、以什么顺序以及最后哪些函数是这些函数(初始化、初始化、启动、applyX、updateX - 这种神奇的函数)。

会澄清很多我相信的事情。
谢谢。

最佳答案

Note: In the following startup description I will skip all that is marked as deprecated. I will also make this description as easy as possible.



首先将加载 Ext.app.Application 它将首先解析并加载所有依赖项。一旦加载了所有依赖项,应用程序 Controller 将
  • 实例化所有 Ext.data.Store s ( constructor() 被调用)
  • 实例化所有 Ext.app.Controller s ( constructor() 被调用)
  • 调用 init() 每个 Ext.app.Controller 上的方法实例
  • 调用 launch() Ext.app.Profile 上的方法实例(如果 Ext.app.Profile 可用)
  • 给自己打电话 launch() 方法
  • 调用 launch() 每个 Ext.app.Controller 上的方法检查 Controller 是否继承自 Ext.app.Controller 后的实例

  • 就是这样。

    constructor() 下对于每个类,只有一堆由组件提供的模板方法(我不会在这里用 mixins 分开)。以下是常见的:
  • initComponent() > 真正重要的配置组件
  • onRender()
  • afterRender()
  • initEvents()
  • setOrientation()

  • 永远不要忘记插入 callParent(arguments)如果您重写一个方法只是为了添加一些功能!

    关于extjs - Sencha Touch 2 - 执行顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17621404/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com