Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    3
    Vote Rating
    0
    mobitex is on a distinguished road

      0  

    Post Unanswered: Uncaught Attempting to create a component with an xtype that has not been registered:

    Unanswered: Uncaught Attempting to create a component with an xtype that has not been registered:


    Hello,

    i try to create a draw component with sencha touch. But i get always the following error:

    "Uncaught Attempting to create a component with an xtype that has not been registered: [object Object]"

    What could that mean ?
    Code:
    Ext.setup({
        tabletStartupScreen: 'tablet_startup.jpg',
        phoneStartupScreen: 'phone_startup.jpg',
        tabletIcon: 'icon-ipad.png',
        phoneIcon: 'icon-iphone.png',
        glossOnIcon: false,
        onReady: function() {
          
    		this.drawComponent = Ext.create('Ext.draw.Component', {
        		xtype: 'chart',
    			viewBox: false,
    		     items: [{
    		        type: 'circle',
    		        fill: '#79BB3F',
    		        radius: 100,
    		        x: 100,
    		        y: 100
        		}]
    		});
    		
    		
    		this.pnl = new Ext.Panel({
    		  fullscreen : true,
    		  style: 'background-color: red;'	
    		}) ;
    		this.pnl.show('pop'); 	
        }
    });
    Kind regards

    Jürgen

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    4
    Vote Rating
    0
    greenkohl23 is on a distinguished road

      0  

    Default


    I don't know, if I'm getting it right, but isnt it mentionted in the drawing Examples? If I'm right i show you how I understand it:

    PHP Code:
    new Ext.Application({
        
    launch: function() {

            
    // Create a draw component
            
    var drawComponent = new Ext.draw.Component({
                
    viewBoxfalse
            
    });

            
    // Create a window to place the draw component in
            
    this.rootpanel = new Ext.Panel({
                
    fullscreen:true,
                
    layout'fit',
                
    items: [drawComponent]
            })

            
    // Add a circle sprite
            
    var myCircle drawComponent.surface.add({
                
    type'circle',
                
    x100,
                
    y100,
                
    radius100,
                
    fill'#cc5'
            
    });

            
    // Now do stuff with the sprite, like changing its properties:
            
    myCircle.setAttributes({
                
    fill'#ccc'
            
    }, true);

            
    // or animate an attribute on the sprite
            
    myCircle.animate({
                
    to: {
                    
    fill'#555'
                
    },
                
    duration2000
            
    });

            
    // Add a mouseup listener to the sprite
            
    myCircle.addListener('mouseup', function() {
                
    alert('mouse upped!');
            });
        }
    }); 
    I hope it would help you.

    ps: sry for my bad englisch

  3. #3
    Sencha User
    Join Date
    Jul 2011
    Posts
    4
    Vote Rating
    0
    JensW is on a distinguished road

      0  

    Default


    Try to use "new Ext.draw.Component"-Syntax instead of Ext.create('...')-Syntax. It worked for me with Ext.chart.Chart.

  4. #4
    Sencha User
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    3
    Vote Rating
    0
    mobitex is on a distinguished road

      0  

    Default Thanks a lot.

    Thanks a lot.


    This it works well.

    Quote Originally Posted by greenkohl23 View Post
    I don't know, if I'm getting it right, but isnt it mentionted in the drawing Examples? If I'm right i show you how I understand it:

    PHP Code:
    new Ext.Application({
        
    launch: function() {

            
    // Create a draw component
            
    var drawComponent = new Ext.draw.Component({
                
    viewBoxfalse
            
    });

            
    // Create a window to place the draw component in
            
    this.rootpanel = new Ext.Panel({
                
    fullscreen:true,
                
    layout'fit',
                
    items: [drawComponent]
            })

            
    // Add a circle sprite
            
    var myCircle drawComponent.surface.add({
                
    type'circle',
                
    x100,
                
    y100,
                
    radius100,
                
    fill'#cc5'
            
    });

            
    // Now do stuff with the sprite, like changing its properties:
            
    myCircle.setAttributes({
                
    fill'#ccc'
            
    }, true);

            
    // or animate an attribute on the sprite
            
    myCircle.animate({
                
    to: {
                    
    fill'#555'
                
    },
                
    duration2000
            
    });

            
    // Add a mouseup listener to the sprite
            
    myCircle.addListener('mouseup', function() {
                
    alert('mouse upped!');
            });
        }
    }); 
    I hope it would help you.

    ps: sry for my bad englisch
    Jürgen Schaar

    mobitecs UG
    Mailänder Str. 2
    30539 Hannover
    Germany
    Tel: +49 (0) 511 165968-54
    Email: j.schaar@mobitecs.de
    Internet: http://mobitecs.de

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    26
    Vote Rating
    2
    rando is on a distinguished road

      0  

    Default


    Thx Mobitex. Your code does work indeed.

    Anyone knows why the draw component doesn't get displayed if I remove the myCircle.animate call? I tried adding a 'this.rootpanel.show(true)' but nothing gets displayed neither

  6. #6
    Sencha User 12ftguru's Avatar
    Join Date
    May 2007
    Posts
    22
    Vote Rating
    1
    12ftguru is on a distinguished road

      0  

    Default Show does not seem to be working

    Show does not seem to be working


    I am seeing the same thing you are rando. The following code does not draw anything unless I add an animate call.

    Code:
    new Ext.Application({
        launch: function() {
    	this.drawComponent = new Ext.draw.Component({
        viewBox: false
      });
    
    
      // Create a window to place the draw component in
      this.rootpanel = new Ext.Panel({
          fullscreen:true,
          layout: 'fit',
          items: [this.drawComponent]
      });
    
         // Add a circle sprite
        this.myCircle = this.drawComponent.surface.add({
            type: 'circle',
            x: 400,
            y: 400,
            radius: 300,
            stroke: '#000000'
        });
    
        this.myCircle.show(true); /* seems like this should do something */
    
      }
    });

  7. #7
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Answers
    17
    Vote Rating
    18
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Try using the renderFrame method on the surface you wish to paint.