Extjs learning experience (1)

Source: Internet
Author: User

By chance, I found the extjs framework. I was so excited when I first saw the effect it was created. Haha, I didn't expect such a beautiful UI control, but I felt like it was used.
Not very good. One of the major disadvantages is that the class library is too large, which will affect the speed. Moreover, the help documentation is all in English, and the English is also good, more importantly, there are no relevant examples in its documentation, just to make
With parameters, it is difficult to grasp, so I had to go to their official forum to ask people everywhere, depressed!

But fortunately, foreigners are generally enthusiastic. Basically, some people will reply to my questions.

I started to use a large number of extjs frameworks in a website that helped my friends do. Although its class library file is very large, it is worth the sacrifice if I feel that this effect can be achieved.

In order not to let myself forget it quickly, I decided to write something here, which will be easier to find in the future. If there is something wrong with it, please correct it in time. Thank you!

Let's talk about extjs udfs first. The following statement can be used to create a function:

View plain
Copy to clipboard
Print
?
  1. Ext. login =
    Function
    (){
  2. Function
    Islogin (){
  3. .
  4. }
  5. Return
    {
  6. Init: Function
    (){
  7. Islogin ();
  8. },
  9. Login: Function
    (){
  10. }
  11. }
Ext.Login=function(){    function IsLogin(){    .    }   return{    init:function(){        IsLogin();    },        Login:function(){                }}

At the beginning, I was quite frustrated by the function calling mechanism in JS. In the above Code, a function called ext will be created. the object of login () should be equivalent to the meaning of a class, and other related methods can be written in it.

In return, the public method is used. The method can be called by external programs (for example, used in HTML files). Code other than return is its private method and can only be used in ext. called in the login () object

If you need to call the login () method on other pages, you can directly write

View plain
Copy to clipboard
Print
?
  1. <Input id =
    "Login"
    Onclick =
    "Ext. login (). login ()"
    />
  <input id="login" onclick="Ext.Login().Login()" />

If you need to call it when loading a page, you can simply use the method in extjs to implement it:

View plain
Copy to clipboard
Print
?
  1. Ext. onready (ext. login. init, ext. login );
Ext.onReady(Ext.Login.init, Ext.Login);

The function name here does not need to be enclosed in parentheses. The first parameter is the method to be called, and the second parameter is the scope. Generally, this object name is used.

Okay. You should pay attention to the calling of basic functions. Then write the Ajax application.

This series of articles is referenced from:
Winson's blog
Http://www.cnblogs.com/winsonet/

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.