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