ExtJS Learning Topic (i) How to apply ExtJS (with example) _extjs

Source: Internet
Author: User
To use ExtJS, first to get ExtJS library files, ExtJS library files can be downloaded to the EXTJS website, address is www.extjs.com/products/gxt/download.php, download the zip compressed file to extract to "d:\ Extcode "directory, you can get the following content.

Adapter: is responsible for providing a third party bottom library (including ext from the bottom of the library) mapped to ext supported by the underlying library.
Build: After the compressed ext all source code (inside classified storage).
Docs:api Help document.
Exmaples: Provides a small example of using ExtJS technology.
Resources:ext UI resource file directories, such as CSS, picture files are stored in this area.
Source: No compression ext all the source code (inside classified storage) comply with the Lesser GNU (LGPL) Open source agreement.
Ext-all.js: Compressed After the full source of ext.
Ext-all-debug.js: No compressed ext all the source code (for debugging).
Ext-core.js: The core components of the compressed EXT, including all classes under Sources/core.
Ext-core-debug.js: Core components without compression ext, including all classes under Sources/core.

After you get the ExtJS library file, you can apply the ExtJS to the page. Application ExtJS need to introduce ExtJS style and ExtJS library file in the page, the JS library file with Resources/css/ext-all.css,extjs style file contains two main, adapter/ext/ Ext-base.js and Ext-all.js, where ext-base.js represents the framework base library, Ext-all.js is the core library of ExtJS. Adapter represents an adapter, which means that it can have multiple adapters, so you can replace adapter/ext/ext-base.js with adapter/jquery/ext-jquery-adapter.js, or adapter/ Prototype/ext-prototype-adapter.js and so on.

As a result, the pages that use the ExtJS framework generally include the following sentences:

After the ExtJS library files and page contents are loaded, ExtJS executes the functions specified in Ext.onready, so it can be used, in general, every user's ExtJS application starts from Ext.onready, and the code that uses the ExtJS application is roughly as follows:

FN can also be written in the form of an anonymous function, so the above code can be changed to the following form:

How, read the above content, is not eager to try? Don't worry, let's write a simple ExtJS application, and enter the following code in the hello.html file:

Look at the page effect:

Further, we can display a window on the page with the following code:

When browsing hello.html, you have to display a window on the screen, as shown in the picture:

Copy Code code as follows:

<%@ Page language= "C #" autoeventwireup= "true" codebehind= "Default.aspx.cs" inherits= "Extjsapptest.default"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title>extjs world</title>
<link rel= "stylesheet" type= "Text/css" href= "Extjs/resources/css/ext-all.css"/>
<script type= "Text/javascript" src= "Extjs/adapter/ext/ext-base.js" ></script>
<script type= "Text/javascript" src= "Extjs/ext-all.js" ></script>
<script>
Ext.onready (function () {
Pop-up warning dialog box.
Ext.MessageBox.alert ("Hello", "Hello, hyey.wl Come to ExtJS world!");
POPs up the window form.
var win = new Ext.window ({title: "Hello", width:300, height:200, HTML: ' Win.show ();
});
</script>
<body>
<form id= "Form1" runat= "Server" >
<div>
</div>
</form>
</body>

This is just a simple example, to make complex functions still need to learn a lot of knowledge, in the next article will introduce ExtJS class library and component introduction, I hope you continue to pay attention to my blog!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.