HasOneConfig Class

Namespace: Ext.data.association

Base Types

System.Object

Constructors

Name Description
HasOneConfig()

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 Person would set up a address_id foreign key. * Ext.define('Person', { extend: 'Ext.data.Model', fields: ['id', 'name', 'address_id'], // refers to the id of the address object hasOne: 'Address' }); * Ext.define('Address', { extend: 'Ext.data.Model', fields: ['id', 'number', 'street', 'city', 'zip'], belongsTo: 'Person' }); var Person = new Person({ id: 1, name: 'John Smith', address_id: 13 }, 1); person.getAddress(); // Will make a call to the server asking for address_id 13 *
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. getAddress
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. setAddress
© Copyright 2005-2011 SharpKit. All rights reserved.