EXT JS Learning

Source: Internet
Author: User

Basic steps for using EXT
<!--introduce the required CSS file/resources/css/ext-all.css--
<link rel= "stylesheet" type= "Text/css" href= "./ext-js/resources/css/ext-all.css" >

<!--introduce the required JS file/resources/css/ext-all.js--
<script language= "javascript" type= "Text/javascript" src= "./ext-js/ext-all.js" ></script>
Bootstrap.js can also be introduced here: This JS will automatically load Ext-all.js or Ext-all-debug.js, in the following cases will be loaded ext-all-debug.js

Example: hello,word!

First look at a function

The Onready function, the statement block within the Onready function, is executed after the page context is loaded:

Equivalent to $ (document) in jquery. Ready (); Indicates that the page has finished loading properly.
Ext.onready (function () {
Simulating popup windows
Ext.MessageBox.alert ("Hello", "hellow,word!");

Window display
var win=new ext.window ({title: "Hello", width:300,height:200,html: ' Win.show ();
});

EXT Create Class

Ext.define (' Textclass ', {

A: "A",

B: "B"

});

Create a class TextClass2, and integrate Textclass

Ext.define (' TextClass2 ', {

Extend: "Textclass";

C: "C",

});

So TextClass2 this class has a a,b,c three attributes.

Instantiate a class of TextClass2

var test = new TextClass2 ();

Alert ("A=" +test. A + "b=" +test. B + "c=" +test. C);

Naming ConventionsClass name If there is more than one paragraph, the first letter is capitalized, the first letter of the last paragraph is capitalized, the middle letter is lowercase

Ext.layout.component.Dock

Array:

var arr = [1,2,3,4,5,6,-1];
//Array traversal
Ext.Array.every (Arr,function (item) {
if (item>0) {
return true; alert (item);
}else{
alert (item);
return false;
}
},this);

//Array filtering
var newArr = Ext.Array.filter (arr,function (item) {
if (item>0) {
return true;
}else{
return false;
}
},this);
Alert (Newarr.join ("\ n"));

EXT JS Learning

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.