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