Results 1 to 4 of 4

Thread: How can i create my own xtype?

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Location
    Venezuela
    Posts
    27
    Vote Rating
    0
      0  

    Default 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 User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Answers
    124
    Vote Rating
    90
      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
    Answers
    132
    Vote Rating
    100
      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
      0  

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •