ExtJS learning -------- other operations in Ext. Element learning, how to learn extjs
(1) alignment operation
(2) dimension operation
(3) Locating
(4) rolling operation
(5) common event Methods
EXTJS learning methods and experience
There seems to be no classic video!
Purchase a book and read extjs.
In addition, let's take a look at the Ext Core manual.
First, you must understand its ideas and style.
Read more source code
I am getting started with extjs. I am now learning how to use Extjs4. I would like to ask how extjs receives and parses json data.
JSON can be understood as a serialized string of JavaScript objects. After reading the JSON content, you will find that the object literal volume written in the Code is basically the same, therefore, you can use the eval method to convert JSON to an object.
Ext is just a simple eval encapsulation method to adapt to different standard JSON
Source code:
Ext. util. JSON. decode = function (json ){
Return eval ('+ json + ')');
};
You can see it by alert.
// Example
Ext. onReady (function (){
Ext. Ajax. request ({
Url: 'getmsg. action? User = 1 ',
Method: 'get ',
Success: function (resp, options ){
// Standard JSON string '{"data": [{"msg": "abcd"}]}'
Var jsonObj = Ext. util. JSON. decode (resp. responseText );
// Display the modal prompt box
Ext. Msg. alert ('title', jsonObj. data [0]. msg, function (btn ){
// Ext's modal window is very important because it only shields operations, does not block threads, and js does not have threads.
// Callback of the button event in the prompt box
Alert (btn); // then run
});
Alert (1); // execute first
}
// Failure: function () {...} // optional
});
});
Ext's ApiDoc is very good at learning. Do not read some so-called Chinese versions. There are many machine translations, and many unproofread errors.
In addition, to learn ExtJS, We need to master the concept of closure. This is a very important feature of js. Ext uses this feature to simulate inheritance and encapsulation, and to some extent implements object-oriented programming. of course, you can also ignore the Ext Inheritance Mechanism and use prototype of js itself)