Hybrid View
-
9 Dec 2011 7:42 PM #1
Answered: PR3 change in container getData?
Answered: PR3 change in container getData?
Hi. Excited to use PR3 - however my app stopped working in some areas.
I have a controller that calls a new view:
I used to be able to access this data in my view in PR2 but no more - now it shows as undefinedCode:getNewView: function() { ..stuff to get data b.loadRecords(a); var a = b.getAt(0); console.log(a.getData()); <-- this shows correct data //then pass the data to return this.getView("Dashboard").create({ title: "Dashboard", data: a.getData() })
I looked at changelog/docs but I don't see anything related to this.Code:Ext.define("SquareRoute.view.Dashboard", { extend: "Ext.Container", xtype: 'dashboard', record: undefined, initialize: function() { var a = this.getData(); console.log(a); <-- empty/undefined
-
Best Answer Posted by rdougan
You must call this.callParent() if you override initialize. Put it before your getData() call and it will work.
-
9 Dec 2011 9:08 PM #2
You must call this.callParent() if you override initialize. Put it before your getData() call and it will work.
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
9 Dec 2011 9:13 PM #3
Just to include why: initialize in component now sets up the configurations. So obviously if you override that method and don't call the parent, the configuration system will not be setup for that class, leaving configurations not working.
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.


Reply With Quote