Common components-Data model components

Source: Internet
Author: User

The Model component is designed to hold Data components.

Property

component-name Component Name

XID Uniqueness identification of components in WEX5

Event

onactive page Activation

oninactive Page left

onmodelcontruct When the data model is created

onmodelcontructdone Data Model creation complete

onLoad Page initialization complete

onunLoad Page Close

onparamsreceive Receive parameters

Example

Verifying the execution precedence of each of the Model events

Definefunction(require) {var$ = require ("jquery"); varJustep = require ("$UI/system/lib/justep"); varModel =function(){         This. Callparent ();    }; Model.prototype.modelActive=function(event) {Console.log ("Model active.");    }; Model.prototype.modelInactive=function(event) {Console.log ("Model inactive.");    }; Model.prototype.modelModelConstruct=function(event) {Console.log ("Model Contruct.");    }; Model.prototype.modelModelConstructDone=function(event) {Console.log ("Model contruct done.");    }; Model.prototype.modelLoad=function(event) {Console.log ("Model load.");    }; Model.prototype.modelParamsReceive=function(event) {Console.log ("Model params receive.");    }; Model.prototype.modelUnLoad=function(event) {Console.log ("Model UN load.");    }; returnModel;});
Output results
Model Contruct.model contruct Done.model load.model params receive.
Conclusion

Event execution Order: onmodelcontruct--onmodelcontructdone--and OnLoad-onparamsreceive

Common components-Data model components

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.