ExtJS Study Notes

Source: Internet
Author: User

Official website: http://docs.sencha.com/extjs/6.5.1/classic/Ext.html
Example demo:https://fiddle.sencha.com/#view/editor&fiddle/255l Password: K2
ExtJS
1. Main control: Application
, View,viewmodel,controller,component,store,model

2, commonly used store:strore (most commonly used), Jsonstore,treestore,arrayliststore (for this underground drawing box)

3. Store
3.1, Storeid:view use, Ext.StoreMgr.get (' storeId '); Globally unique, easy to be washed away
3.2, recommend the use of Viewmodel.getstore (' VM '); Grid.getstore ();
3.3, AutoLoad is true when the instance is loaded, otherwise it is loaded when the Load method is called
3.4, store can use proxy to load restful

4. Controller
4.1, the controller of the wording as far as possible without listen, with the method of Init
4.2, Initviewmodel, can ensure the completion of ViewModel instantiation
4.3, through this.getreferences () can get all the views of the reference
Example:
----Holder1 (Holder)----This.getview ()--top floor
--------Type10----Holder1.type10
--------TYPE20----HOLDER1.TYPE20
------------TYPE21----HOLDER1.TYPE21
------------Holder2 (Holder)----HOLDER1.HOLDER2
----------------type1----Holder1.holder2.type1
4.4. Get total objects by This.getviewmodel ()

5. Model
5.1, model only defines the structure, can be loaded by proxy restful

6. The difference between model and store
6.1. Model is a piece of data
6.2, Store is the list of mode
6.3, use the model in the VM is with links, using the store is stores, using data is local
6.4. The store contains the model attribute

7, ViewModel
7.1, links inside the create:true represents the new an empty object, if it is create:{id:123}, represents a new object containing the ID data
7.2, Links:id:12 to request the primary key ID 12 data from the background, (ID is not fixed notation is not OK)

8. Custom bidirectional bind attribute
8.1. Reference Url:http://docs.sencha.com/extjs/6.5.1/classic/ext.class.html#cfg-config
8.2, two-way binding if you have a decimal point representing the way a JSON object is accessed.
For example {Task.types.url}, you can set the value in the VM using Viewmodel.set ("task": {types:{url: "AAA"})
You can also use Set (' Task.types.url ', ' XXX ') to assign a value, or a JSON object will be generated by default.

9. Data type:
String,integer,number,bool,date
Reference Address: http://docs.sencha.com/extjs/6.5.1/classic/Ext.data.field.String.html

10, view.

10.1, define a referenceholder:true, each descendant node after this attribute can define a reference,referenceholder can also be nested use, under the same referenceholder, regardless of how many levels, Cannot duplicate the same name, leveling floats to the same referenceholder layer.

11. Error hints

12. Data local (write dead)

ExtJS Study Notes

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.