-
24 Jul 2012 7:07 PM #1
Answered: How can i create my own xtype?
Answered: How can i create my own xtype?
Hi sencha community,
well, this is the problem, i want create a button that when it's tapped it's throw a field below it, like a cascade or chains of texfields, ¿How can i do that? i think that i can create my own xtype maybe a can do this, so any suggestions??
and another little thing, ¿where i can find the css of sencha docs examples? (i want implement the navigation.view example but i cant load the headshots i think that is because the css).
Thanks in advanced.
-
Best Answer Posted by sword-it
Hi
You can define your own xtype on a custom component by specifying the alias config option with a prefix of widget. For example:
Code:Ext.define('PressMeButton',{ extend:'Ext.button.Button', alias:'widget.pressmebutton', text:'Press Me'})
For more about alias see http://docs.sencha.com/touch/2-0/#!/api/Ext.Class-cfg-alias
-
25 Jul 2012 3:01 AM #2Sencha - Community Support Team
- Join Date
- May 2012
- Location
- Istanbul
- Posts
- 1,331
- Vote Rating
- 76
- Answers
- 124
Hi
You can define your own xtype on a custom component by specifying the alias config option with a prefix of widget. For example:
Code:Ext.define('PressMeButton',{ extend:'Ext.button.Button', alias:'widget.pressmebutton', text:'Press Me'})
For more about alias see http://docs.sencha.com/touch/2-0/#!/api/Ext.Class-cfg-alias
sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
25 Jul 2012 4:08 AM #3
Using the xtype rather than alias is easier for beginners. Seems more straightforward.
Code:Ext.define('mybutton', { extend: 'Ext.button.Button', xtype: 'mybutton', config: { ... } });
-
25 Jul 2012 5:34 AM #4
Ok, thanks.. I will try to create my own xtype.


Reply With Quote