-
21 Jun 2012 3:09 AM #1
The getter of Controller is fail!
The getter of Controller is fail!
Hi guys,
I have some troubles with the getter when I configured the refs for Controller. The getter only available with only one member in refs, the others was fail.
I have two views:
Code:Ext.define('Test.view.panelEdit', { extend: 'Ext.Panel', config: { id: 'panelEdit', layout: { type: 'fit' }, items: { xtype:'button', id: 'buttonNew', text: 'New' } } });and one controller:Code:Ext.define('Test.view.panelList', { extend: 'Ext.Panel', config: { id: 'panelList', layout: { type: 'fit' } } });
Error: getterBug.jpgCode:Ext.define('Test.controller.controllerMain', { extend: 'Ext.app.Controller', config: { views: ['panelEdit', 'panelList'], refs: { panelEdit: '#panelEdit', panelList: '#panelList' }, control: { "#buttonNew": { tap: 'onButtonNewTap' } } }, onButtonNewTap: function(button, e, options) { var edit = this.getPanelEdit(); var list = this.getPanelList(); console.log(edit.getId()); console.log(list.getId()); } });
But when I call the getter in the controller, it's not operate?
What should I do?
-
21 Jun 2012 5:03 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
Your code is working for me in 2.0.1.1, tapped the button 3 times and it worked all 3 times.
Screen Shot 2012-06-21 at 8.02.47 AM.pngMitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
21 Jun 2012 7:05 PM #3
still not work!
still not work!
Hi mitchellsimoens,
I have tested again on the Safari and Chrome, but it still not work. I don't know why.
I'm using sencha-touch 2.0.1.1 and sdk tool 2.0.0 beta 3 on Window 7 OS.
Do you have any suggestion for my trouble?
Thanks!
-
26 Jun 2012 1:02 AM #4
fixed
fixed
Hi,
I have found the reason
. Because I only add one panel to the viewport, but we must add both of them to viewport if you want the getter'll work.
Thanks all.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote