Extjs MVC learning essay 01, extjsmvc essay 01

Source: Internet
Author: User

Extjs MVC learning essay 01, extjsmvc essay 01

The entire Mvc Framework in Extjs MVC mode is:

Includes the Controller (Implementation Method layer), Store (data source management layer), and View (page layout Layer ). I think the reason for using MVC is to reduce the development of a single JS for a page. Why? You can see that Extjs code that does not use MVC mode:

(Because I am a newbie, the Code may be a bit redundant)

It's just a page, and the amount of code has already reached more than a thousand lines. As you can imagine, the amount of code is certainly annoying for pages with complicated functions that are developed with a single Extjs UI (the most important thing is to flip it over, the mouse wheel is annoying ...). And if you have written this page and other pages have components with the same function, do you have to Copy the page again and write the repeated code again .... then the thief is disgusting.

I. View creation:

Just like my current project: an Internet medical project adopts the Extjs MVC mode as a whole. If you create a component, we can give it an "xtype ":, then, when you need to call this component or page, you only need to configure all items in items and write it as: {xtype :'... '}, you can use this component. Of course, you must also note that there is a "requires" attribute on the component creation page, here, you need to write the paths of all pages that reference this component, and then the reference page can call this component.

Ii. Controller:

If one of our search buttons has a handler, we can write this method into the controller. For example, persistence is a harvest. If one students, it is impossible to write down the progress of life and learning, looking back, it is also a fortune.

------ To Yourself

 

Related Article

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.