BelongsToConfig Class

Namespace: Ext.data.association

Base Types

System.Object

Constructors

Name Description
BelongsToConfig()

Properties

Name Description
foreignKey The name of the foreign key on the owner model that links it to the associated model. Defaults to the lowercased name of the associated model plus "_id", e.g. an association with a model called Product would set up a product_id foreign key. * Ext.define('Order', { extend: 'Ext.data.Model', fields: ['id', 'date'], hasMany: 'Product' }); * Ext.define('Product', { extend: 'Ext.data.Model', fields: ['id', 'name', 'order_id'], // refers to the id of the order that this product belongs to belongsTo: 'Group' }); var product = new Product({ id: 1, name: 'Product 1', order_id: 22 }, 1); product.getOrder(); // Will make a call to the server asking for order_id 22 *
getterName The name of the getter function that will be added to the local model's prototype. Defaults to 'get' + the name of the foreign model, e.g. getCategory
setterName The name of the setter function that will be added to the local model's prototype. Defaults to 'set' + the name of the foreign model, e.g. setCategory
© Copyright 2005-2011 SharpKit. All rights reserved.