Ext Introductory Learning Series (ii) Popup form

Source: Internet
Author: User

Chapter Two Popup form

The previous section learned the environment of ext and the most basic operation-pop-up dialog box, as a primer, this section describes how to pop up a new form, from the example to explain the basic operating principle of ext.

What does ext form look like?

First to look at a few effects, I believe that with the depth of study, we will be Ext's gorgeous conquered. Here are some of the basic forms of ext popup:

We can find that the 2 pop-up forms are much more beautiful than our traditional Web pages, and more valuable is the ability to switch styles at will. So how does this kind of form pop up?

Second, ext pop-up form ideas

When the environment is set up correctly, the introduction of the page is also correct, you can follow the following ideas to write code:

First step: Build a basic code shelf, such as

<script type= "Text/javascript" >
function Start () {
Write specific code here
}
Ext.onready (start);//Entry function
</script>

The second step: The new object, passing in the corresponding parameters. Common parameters are title (title), height (height), Width (width), content (HTML), and so on. These parameters are all enclosed in curly brackets, separated by commas in the middle of each parameter. The reference code is as follows:

var win = new Ext.window ();

After the arguments are passed in the constructor:

var win = new Ext.window ({title: "Test title", height:300, width:500, HTML: "

Description: Where HTML attributes can be written and parsed HTML tags, can be modified inside the font and so on.

Finally, let the form object show up and call his show () method:

Win.show ();

Then, run the webpage and get the following effect:

, this form can be dragged by default, and dragging the default effect is a shadow and background discoloration feature. In this example, the complete code is as follows:

<HTML>
<HEAD>
<TITLE> Popup Form </TITLE>
<link rel= "stylesheet" type= "Text/css" href= "Ext/resources/css/ext-all.css"/>
<script type= "Text/javascript" src= "Ext/ext-base.js" ></script>
<script type= "Text/javascript" src= "Ext/ext-all.js" ></script>
<script type= "Text/javascript" src= "Ext/ext-lang-zh_cn.js" charset= "Utf-8" ></script>
</HEAD>
<script type= "Text/javascript" >
function Start () {
var win = new Ext.window ({title: "Test title", height:300, width:500, HTML: "Win.show ();
}
Ext.onready (start);//Program entry
</script>
<BODY>
</BODY>
</HTML>

Three, Summary:

The Window object is a special panel that is dedicated to the window in your program. Windows by default is Draggable, floating, and provides a number of specific behaviors such as maximizing, restoring, and events. There are many other properties and events, this chapter is not detailed in the moment, because the course is just beginning, the following will provide the API documentation, you can refer to the implementation of more powerful pop-up form.
This chapter code download

Ext Introductory Learning Series (ii) Popup form

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.