1
모델 배너와 BannerFormat 모델이 있습니다. 배너에는 배너 형식이 있습니다. 배너와 배너 형식 사이에 hasOne의 관계를 구성하려면, 내가 쓴 : 내가 banner.getBannerFormat()를 호출 할 때, 내가 가진sencha touch를 사용하여 hasOne 모델을 얻는 방법
Ext.define('admin.model.BannerFormat', {
extend: 'Ext.data.Model',
config: {
fields: ['id', 'format'],
associations: { type: 'hasMany', model: 'admin.model.Banner' },
proxy: {
type: 'ajax',
url: '/admin/api_query.php',
extraParams: {
table: 'content_banner_formats',
type: 'GET'
}
}
}
});
:
Ext.define('admin.model.Banner', {
extend: 'Ext.data.Model',
config: {
fields: [
{ name: 'id', type: 'int' },
{ name: 'banner_format_id', type: 'int' },
'code',
'active',
'start_at',
'end_at'
],
associations: { type: 'hasOne', model: 'admin.model.BannerFormat', getterName: 'getBannerFormat' },
proxy: {
type: 'ajax',
url: '/admin/api_query.php',
extraParams: {
table: 'content_banners',
type: 'GET'
}
}
}
});
그리고 내 bannerFormat 모델
Uncaught TypeError: Object [object Object] has no method 'getBannerFormat'
무엇이 잘못 되었나요?