Table of Contents
2.1Extjs组件简介
2.2Extjs组件的应用
Home Database Mysql Tutorial Extjs+Grails教程系列2(Extjs组件大致介绍)

Extjs+Grails教程系列2(Extjs组件大致介绍)

Jun 07, 2016 pm 03:13 PM
extjs Tutorial series components

教程1补充: 如果跟着教程1做完后,你肯定会既激动又纳闷,网页里面的脚本到底是什么意思?比如Ext.onReady(function(){...}) ; 这个Ext.onReady()意思就是只有在Ext框架全部加载完后才能在客户端的代码中使用Ext,而Ext的onReady正是在Ext框架及页面的html

教程1补充:

如果跟着教程1做完后,你肯定会既激动又纳闷,网页里面的脚本到底是什么意思?比如Ext.onReady(function(){...}) ;

这个Ext.onReady()意思就是只有在Ext框架全部加载完后才能在客户端的代码中使用Ext,而Ext的onReady正是在Ext框架及页面的html代码加载完后用来注册所要执行的函数。

具体参考信息的话,大家可以参考这里:

1:http://book.51cto.com/art/201003/191905.htm

2:http://dujuntian.blog.163.com/blog/static/2837755420103160461840/

写到这里,我说几句废话:本人写这些博客,一来是让新手快速上手,因为这些文章是我学了历程的体现,大家可以参考,二来给自己做个总结,至于理解,可以在后面学习深入情况下,慢慢加深。我在公司做Ext,刚开始也是短时间就让做出界面,至于理解,也是模模糊糊的,我也是参考例子给一点一点摸索出来,后来等自己学得差不多的时候再回头去看,觉得Extjs真的并没有想象的那么恐怖,知识如果之前从来没接触过的话,刚开始学习坡度确实陡了点。还好,只要大家坚持,2个礼拜,基本都能很熟悉Extjs。

2.1Extjs组件简介

    Ext JS还设计了良好的组件体系,组件大致可以分成三大类,即基本组件、工具栏组件、表单及元素组件。

    本人建议:新手刚开始的话,可以接触FormPanel作为入手学习,等自己的FormPanel学得不错了,就可以迁移到更多的组件学习,毕竟,在现在的Web开发中,表单用的是最多的。

    创建一个组件,通用的方法是跟java差不多,通过关键字new出来一个对象。比如一个按钮,可以这么写

Ext.onReady(function(){
	var oTestButton = new Ext.Button({
		//以下是配置信息
		renderTo:Ext.getBody() ,//渲染到网页上面
		text:'这是按钮上的文字',//按钮文字
		handler:function(){
			alert('点击按钮就会调用我') ;
		}//这个是点击按钮激发的事件,handler只对按钮起作用
	}) ;
}) ;
Copy after login

  上面一个简单的几行代码,就创建出来一个按钮对象,如果想创建其他不同的对象,都可以参照以上方式。在Extjs中,用xtype区分不同的组件,xtype就像各个组件类型的代号一样,比如定义xtype为button,那么组件将以button显示出来,如果定义xtype为form,那么组件将以表单组件显示。到后面的应用中,大家都会明白xtype的含义。

    在Extjs中,所有的组件的xtype定义如下:
    xtype属性的基本组件列表

xtype

   

box

Ext.BoxComponent,具有边框属性的组件

button

Ext.Button,按钮

colorpalette

Ext.ColorPalette,调色板

component

Ext.Component,组件

container

Ext.Container,容器

cycle

Ext.CycleButton,可自动循环的分割按钮

dataview

Ext.DataView,数据显示视图

datepicker

Ext.DatePicker,日期选择面板

editor

Ext.Editor,编辑器

editorgrid

Ext.grid.EditorGridPanel,可编辑的表格

grid

Ext.grid.GridPanel,表格

paging

Ext.PagingToolbar,工具栏中的间隔

panel

Ext.Panel,面板

progress

Ext.ProgressBar,进度条

splitbutton

Ext.SplitButton,可分裂的按钮

tabpanel

Ext.TabPanel,选项面板

treepanel

Ext.tree.TreePanel,树

viewport

Ext.ViewPort,视图

window

Ext.Window,窗口

xtype属性的表单组件列表

xtype

   

form

Ext.FormPanelForm面板

checkbox

Ext.form.Checkboxcheckbox录入框

combo

Ext.form.ComboBoxcombo选择项

datefield

Ext.form.DateField,日期选择项

field

Ext.form.Field,表单字段

fieldset

Ext.form.FieldSet,表单字段组

hidden

Ext.form.Hidden,表单隐藏域

htmleditor

Ext.form.HtmlEditorhtml编辑器

numberfield

Ext.form.NumberField,数字编辑器

radio

Ext.form.Radio,单选按钮

textarea

Ext.form.TextArea,区域文本框

textfield

Ext.form.TextField,表单文本框

timefield

Ext.form.TimeField,时间录入项

trigger

Ext.form.TriggerField,触发录入项

xtype属性的工具栏组件列表

xtype

   

toolbar

Ext.Toolbar,工具栏

tbbutton

Ext.Toolbar.Button,按钮

tbfill

Ext.Toolbar.Fill,文件

tbitem

Ext.Toolbar.Item,工具条项目

tbseparator

Ext.Toolbar.Separator,工具栏分隔符

tbspacer

Ext.Toolbar.Spacer,工具栏空白

tbsplit

Ext.Toolbar.SplitButton,工具栏分隔按钮

tbtext

Ext.Toolbar.TextItem,工具栏文本项

 

2.2Extjs组件的应用

其实,在Extjs提供的API里面,还有Extjs提供的Example里面,已经有很多的例子了,大家参考下例子,对应着API各个组件的属性,方法,应该都是可以慢慢摸索出来的,我学习的历程,几乎就是摸索Example代码的过程,把Example看差不多了,Extjs你也就掌握差不多了。

 

 

 

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Tutorial on how to use Dewu Tutorial on how to use Dewu Mar 21, 2024 pm 01:40 PM

Dewu APP is currently a very popular brand shopping software, but most users do not know how to use the functions in Dewu APP. The most detailed usage tutorial guide is compiled below. Next is the Dewuduo that the editor brings to users. A summary of function usage tutorials. Interested users can come and take a look! Tutorial on how to use Dewu [2024-03-20] How to use Dewu installment purchase [2024-03-20] How to obtain Dewu coupons [2024-03-20] How to find Dewu manual customer service [2024-03-20] How to check the pickup code of Dewu [2024-03-20] Where to find Dewu purchase [2024-03-20] How to open Dewu VIP [2024-03-20] How to apply for return or exchange of Dewu

In summer, you must try shooting a rainbow In summer, you must try shooting a rainbow Jul 21, 2024 pm 05:16 PM

After rain in summer, you can often see a beautiful and magical special weather scene - rainbow. This is also a rare scene that can be encountered in photography, and it is very photogenic. There are several conditions for a rainbow to appear: first, there are enough water droplets in the air, and second, the sun shines at a low angle. Therefore, it is easiest to see a rainbow in the afternoon after the rain has cleared up. However, the formation of a rainbow is greatly affected by weather, light and other conditions, so it generally only lasts for a short period of time, and the best viewing and shooting time is even shorter. So when you encounter a rainbow, how can you properly record it and photograph it with quality? 1. Look for rainbows. In addition to the conditions mentioned above, rainbows usually appear in the direction of sunlight, that is, if the sun shines from west to east, rainbows are more likely to appear in the east.

Tutorial on how to turn off the payment sound on WeChat Tutorial on how to turn off the payment sound on WeChat Mar 26, 2024 am 08:30 AM

1. First open WeChat. 2. Click [+] in the upper right corner. 3. Click the QR code to collect payment. 4. Click the three small dots in the upper right corner. 5. Click to close the voice reminder for payment arrival.

DisplayX (monitor testing software) tutorial DisplayX (monitor testing software) tutorial Mar 04, 2024 pm 04:00 PM

Testing a monitor when buying it is an essential part to avoid buying a damaged one. Today I will teach you how to use software to test the monitor. Method step 1. First, search and download the DisplayX software on this website, install it and open it, and you will see many detection methods provided to users. 2. The user clicks on the regular complete test. The first step is to test the brightness of the display. The user adjusts the display so that the boxes can be seen clearly. 3. Then click the mouse to enter the next link. If the monitor can distinguish each black and white area, it means the monitor is still good. 4. Click the left mouse button again, and you will see the grayscale test of the monitor. The smoother the color transition, the better the monitor. 5. In addition, in the displayx software we

Xiaomi 15 series full codenames revealed: Dada, Haotian, Xuanyuan Xiaomi 15 series full codenames revealed: Dada, Haotian, Xuanyuan Aug 22, 2024 pm 06:47 PM

The Xiaomi Mi 15 series is expected to be officially released in October, and its full series codenames have been exposed in the foreign media MiCode code base. Among them, the flagship Xiaomi Mi 15 Ultra is codenamed "Xuanyuan" (meaning "Xuanyuan"). This name comes from the Yellow Emperor in Chinese mythology, which symbolizes nobility. Xiaomi 15 is codenamed "Dada", while Xiaomi 15Pro is named "Haotian" (meaning "Haotian"). The internal code name of Xiaomi Mi 15S Pro is "dijun", which alludes to Emperor Jun, the creator god of "The Classic of Mountains and Seas". Xiaomi 15Ultra series covers

What software is photoshopcs5? -photoshopcs5 usage tutorial What software is photoshopcs5? -photoshopcs5 usage tutorial Mar 19, 2024 am 09:04 AM

PhotoshopCS is the abbreviation of Photoshop Creative Suite. It is a software produced by Adobe and is widely used in graphic design and image processing. As a novice learning PS, let me explain to you today what software photoshopcs5 is and how to use photoshopcs5. 1. What software is photoshop cs5? Adobe Photoshop CS5 Extended is ideal for professionals in film, video and multimedia fields, graphic and web designers who use 3D and animation, and professionals in engineering and scientific fields. Render a 3D image and merge it into a 2D composite image. Edit videos easily

Experts teach you! The Correct Way to Cut Long Pictures on Huawei Mobile Phones Experts teach you! The Correct Way to Cut Long Pictures on Huawei Mobile Phones Mar 22, 2024 pm 12:21 PM

With the continuous development of smart phones, the functions of mobile phones have become more and more powerful, among which the function of taking long pictures has become one of the important functions used by many users in daily life. Long screenshots can help users save a long web page, conversation record or picture at one time for easy viewing and sharing. Among many mobile phone brands, Huawei mobile phones are also one of the brands highly respected by users, and their function of cropping long pictures is also highly praised. This article will introduce you to the correct method of taking long pictures on Huawei mobile phones, as well as some expert tips to help you make better use of Huawei mobile phones.

Angular components and their display properties: understanding non-block default values Angular components and their display properties: understanding non-block default values Mar 15, 2024 pm 04:51 PM

The default display behavior for components in the Angular framework is not for block-level elements. This design choice promotes encapsulation of component styles and encourages developers to consciously define how each component is displayed. By explicitly setting the CSS property display, the display of Angular components can be fully controlled to achieve the desired layout and responsiveness.

See all articles