sencha architect 2 官方实例 Linked Instances
代码可重用是创建一个可维护软件系统的基本要素,architect可以帮助你把应用中的可复用类抽取出来。 每一个architect inspector的最外层实例代表一个类 architect能让你从上至下的开发或从下至上的开发,如果你从一个单一view容器开始,你将不断更改类的配置
代码可重用是创建一个可维护软件系统的基本要素,architect可以帮助你把应用中的可复用类抽取出来。
每一个architect inspector的最外层实例代表一个类
architect能让你从上至下的开发或从下至上的开发,如果你从一个单一view容器开始,你将不断更改类的配置来增强它。如果你从一开始就专注于构建单个特定的展现形式来设计你的应用程序,然后再组装起来,你就可以用Linked Instances来实现
使用Linked Instances的目的就在于重用,你创建了一个通用组件,或xtype,然后创建一个Linked Instances,这样他就能再任何你需要它的时候重用它
更改最初的组件,所有此组件的Linked Instances都会跟着变化,每一个Linked Instances继承所有的变化。你也可以单独编辑Linked Instances。更改属性将覆写最初的组件。当你用另一个architect特性 增强类 时(在inspector中右键点击一个组件),这个变得非常有用
例子
增加一个Form Panel作为顶层组件,增加一个FieldSet和两个Text Fields到里面。设置form的userClassName -> SpecialForm, userAlias -> specialform。看截图
增加一个Window作为第二个顶层组件在inspector中,拖动SpecialForm到这个window中,会有弹出框出现 问你是copy move还是link,选择link。这样 architect 创建了一个MyWindow内的SpecialForm的Linked Instances 名叫 MyForm,还创建了一个能再项目中重用的 xtype 名为 specialform,如下图:
让我们来在一个viewport中重用这个specialform,增加一个Viewport顶层组件,在inspector中,拖动顶层组件SpecialForm到viewport中,弹出框选择link,architect创建了第二个 SpecialForm的Linked Instances,如下图:
如果最初的组件发生变化 那么其他的两个也会发生变化。也可以点击其中一个更改 请自行尝试
用覆写做更多的Linked Instances
有时可视化视图可能无法通过拖拽完成一些操作,如 你想在viewport的实例form中添加一个ComboBox就是不行的
为了做这个,创建一个包含一个combobox的覆写。选择viewport 点击Code按钮,点击Create Override。用编辑器创建覆写initComponent。但是注意这在界面中是显示不出来的,因为architect并不认识覆写代码,运行时能看到
好了 链接实例 就讲到这里了

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Support Vector Machine (SVM) in Python is a powerful supervised learning algorithm that can be used to solve classification and regression problems. SVM performs well when dealing with high-dimensional data and non-linear problems, and is widely used in data mining, image classification, text classification, bioinformatics and other fields. In this article, we will introduce an example of using SVM for classification in Python. We will use the SVM model from the scikit-learn library

The relationship between the number of Oracle instances and database performance Oracle database is one of the well-known relational database management systems in the industry and is widely used in enterprise-level data storage and management. In Oracle database, instance is a very important concept. Instance refers to the running environment of Oracle database in memory. Each instance has an independent memory structure and background process, which is used to process user requests and manage database operations. The number of instances has an important impact on the performance and stability of Oracle database.

Golang is a powerful and efficient programming language that can be used to develop various applications and services. In Golang, pointers are a very important concept, which can help us operate data more flexibly and efficiently. Pointer conversion refers to the process of pointer operations between different types. This article will use specific examples to learn the best practices of pointer conversion in Golang. 1. Basic concepts In Golang, each variable has an address, and the address is the location of the variable in memory.

As the new generation of front-end frameworks continues to emerge, VUE3 is loved as a fast, flexible, and easy-to-use front-end framework. Next, let's learn the basics of VUE3 and make a simple video player. 1. Install VUE3 First, we need to install VUE3 locally. Open the command line tool and execute the following command: npminstallvue@next Then, create a new HTML file and introduce VUE3: <!doctypehtml>

With the popularity of the Internet, verification codes have become a necessary process for login, registration, password retrieval and other operations. In the Gin framework, implementing the verification code function has become extremely simple. This article will introduce how to use a third-party library to implement the verification code function in the Gin framework, and provide sample code for readers' reference. 1. Install dependent libraries Before using the verification code, we need to install a third-party library goCaptcha. To install goCaptcha, you can use the goget command: $goget-ugithub

VAE is a generative model, its full name is VariationalAutoencoder, which is translated into Chinese as variational autoencoder. It is an unsupervised learning algorithm that can be used to generate new data, such as images, audio, text, etc. Compared with ordinary autoencoders, VAEs are more flexible and powerful and can generate more complex and realistic data. Python is one of the most widely used programming languages and one of the main tools for deep learning. In Python, there are many excellent machine learning and deep

With the rapid development of the Internet, data has become one of the most important resources in today's information age. As a technology that automatically obtains and processes network data, web crawlers are attracting more and more attention and application. This article will introduce how to use PHP to develop a simple web crawler and realize the function of automatically obtaining network data. 1. Overview of Web Crawler Web crawler is a technology that automatically obtains and processes network resources. Its main working process is to simulate browser behavior, automatically access specified URL addresses and extract all information.

Generative Adversarial Networks (GAN) is a deep learning algorithm that uses two neural networks to compete with each other to generate new data. GAN is widely used for generation tasks in image, audio, text and other fields. In this article, we will use Python to write an example of a GAN algorithm for generating images of handwritten digits. Dataset Preparation We will use the MNIST data set as our training data set. The MNIST data set contains
