-
13 Dec 2011 3:50 AM #1
down(String selector) method from Container class is not working anymore
down(String selector) method from Container class is not working anymore
For example I have a panel "view" that contains a button with ID myButton.
In touch 1 and touch 2 pr1, I can select the button with view.down('#myButton')
The down method works in touch 2 pr1, but it doesn't any more in pr2 or pr3.
Is there any alternatives in new versions?
-
13 Dec 2011 7:27 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Works for me in PR3:
Code:var cnt = Ext.create('Ext.Container', { fullscreen : true, items : [ { xtype : 'button', itemId : 'myButton', text : 'Test' }, { xtype : 'toolbar', docked : 'top', items : [ { xtype : 'button', itemId : 'myButton', text : 'Hello' } ] } ] }); console.log(cnt.down('#myButton')); console.log(cnt.down('toolbar #myButton'));Mitchell 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.
-
13 Dec 2011 7:39 AM #3
I ran into this exact issue with PR3. Something has changed. I fixed it by not using this.down() in my custom view but using down() on a specific element like Mitchell pointed out above.
-
13 Dec 2011 7:54 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Mitchell 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.
-
13 Dec 2011 8:00 AM #5
-
13 Dec 2011 8:00 AM #6
-
13 Dec 2011 8:03 AM #7Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Mitchell 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.
-
13 Dec 2011 9:08 AM #8
Tested, if I put like this:
. Notice the '_' character. Then the down() method works.Code:Ext.apply(this, { _itemId: this.name + 'Button' });
Seems like Ext.apply doesn't change the _itemId if declared like this:
Code:Ext.apply(this, { itemId: this.name + 'Button' });
-
13 Dec 2011 9:36 AM #9
Where are you adding that code? You should never do that anymore. You should always use the setter (setItemId).
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
13 Dec 2011 9:39 AM #10


Reply With Quote