How extjs processes associations

Source: Internet
Author: User
Extjs uses the model layer and ing to associate the object attributes Ext. define (& amp; #39; Business. model. businessRequest. brUnitRuleModel & amp; #39;, {extend: & amp; #39; Ext. data. model & amp; #39;, fi

Extjs uses the model layer and ing to associate the corresponding object attributes.
Ext. define ('business. model. businessRequest. brunitrulemodel ',{
Extend: 'ext. data. model ',
Fields: ['id', 'code', 'description', 'typename', 'type', {name: 'typecode', mapping: 'brunitruletype. Code'}],
// Belonsto: 'Business. model. businessRequest. brunitruletypemodel ',
IdProperty: 'id'
});
You can use typecode to display data in the grid,
Mapping is the code of the brUnitRuleType entity under the corresponding rule attribute. This method can be used to associate objects,
After extjs4.0, the model feature is enhanced. There is a one-to-many, many-to-one, and many-to-many relationship. There may be better solutions. If you know, please reply to me. Thank you,

Processing of data to be displayed by exjts:

{
Header: 'approval status ',
DataIndex: 'approvalstatus ',
Renderer: function (value ){
If (value = '0 '){
Return 'unapproved ';
}
If (value = '1 '){
Return 'approved ';
}
}
}


Author: woshiyjk
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.