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