-
30 Mar 2011 2:19 AM #1
[CLOSED]cannot extend Model having associations (PR5)
[CLOSED]cannot extend Model having associations (PR5)
Trying to extend User Model as below triggers a 'config.ownerModel is undefined' error. It seems that Ext.data.Association.constructor is called without config while overriding Model.
CheersCode:Ext.regModel('Post', { fields: ['id', 'user_id'], belongsTo: 'User', hasMany : {model: 'Comment', name: 'comments'} }); Ext.regModel('Comment', { fields: ['id', 'user_id', 'post_id'], belongsTo: 'Post' }); Ext.regModel('User', { fields: ['id'], hasMany: [ 'Post', {model: 'Comment', name: 'comments'} ] }); Ext.regModel('UserExtend',{ extend: 'User' });
c.
-
30 Mar 2011 6:33 PM #2
If I run your code against B1 no errors are thrown. Can you confirm?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
30 Mar 2011 11:42 PM #3
Congrats to the team for the Beta !
I can confirm: this problem does not persist under B1
Cheers
C.
-
31 Mar 2011 12:05 AM #4
FYI there's no reason to use regModel anymore, you can extend directly:
This means you can declare your models like any other classes.Code:Ext.define('Foo', { extend: 'Ext.data.Model', fields: ['bar', 'baz'] });Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
How to extend a Model
By AndreaCammarata in forum Sencha Touch 1.x: DiscussionReplies: 15Last Post: 31 Aug 2011, 5:16 PM -
[FIXED][BUG][PR 3] Names of model associations automatic functions collide
By kveeiv in forum Ext:BugsReplies: 4Last Post: 20 Mar 2011, 8:14 PM -
[CLOSED][3.0rc3] Ext.extend and xtype problem?
By netski in forum Ext 3.x: BugsReplies: 2Last Post: 2 Jul 2009, 5:36 AM


Reply With Quote