1. #1
    Sencha User
    Join Date
    Jun 2012
    Location
    Venezuela
    Posts
    27
    Vote Rating
    0
    duranmla is on a distinguished road

      0  

    Default 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.

  2. 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



  3. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    Answers
    124
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      2  

    Default


    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.

  4. #3
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Vote Rating
    99
    Answers
    132
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    Using the xtype rather than alias is easier for beginners. Seems more straightforward.
    Code:
    Ext.define('mybutton', {
        extend: 'Ext.button.Button',
        xtype: 'mybutton',
        config: { ... }
    });

  5. #4
    Sencha User
    Join Date
    Jun 2012
    Location
    Venezuela
    Posts
    27
    Vote Rating
    0
    duranmla is on a distinguished road

      0  

    Default


    Ok, thanks.. I will try to create my own xtype.

Thread Participants: 2

Tags for this Thread