Hybrid View

  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    19
    Vote Rating
    0
    fermina is on a distinguished road

      0  

    Default Uncaught TypeError: Cannot read property 'parentNode' of undefined ext-touch-debug.js

    Uncaught TypeError: Cannot read property 'parentNode' of undefined ext-touch-debug.js


    Hi,

    After the upgrade to version 0.98 following problems arise.
    When Panel on the Carousel has the toolbar, if you delete card and create, the following error occurs.

    Uncaught TypeError: Cannot read property 'parentNode' of undefined ext-touch-debug.js:25504

    The top left of the toolbar button will delete the second card and create.
    It's operated normally at Version 0.97.
    The code is shown below.
    Code:
    <!doctype html>
    <html>
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    	<title>test</title>
    		<!--link rel="stylesheet" href="../../resources/css/sencha-touch.css" type="text/css"-->
    		<link rel="stylesheet" href="../../resources/css/apple.css" type="text/css">
    		<script type="text/javascript" src="../../ext-touch-debug.js"></script>
    		<script type="text/javascript">
    			Ext.ns('test');
    
    			test.MainPanel = Ext.extend(Ext.Carousel, {
    				fullscreen: true,
    				layout: 'fit',
    				activeItem: 0,
    				defaults: {
    					cls: 'card'
    				},
    
    				initComponent: function() {
    					this.dockedItems = [{
    						xtype: 'toolbar',
    						dock: 'top',
    						items: [{
    							text: '111',
    							scope: this,
    							handler: this.onButtonTap
    						}, {
    							text: '222',
    							scope: this,
    							handler: this.onButtonTap
    						}],
    						title: 'Main Title'
    					}];
    					
    					this.items = [{
    						html: 'Card 1',
    						style: {background: '#fff'}
    					}, {
    						html: 'Card 2',
    						style: {background: '#f00'}
    					}];
    					
    					test.MainPanel.superclass.initComponent.call(this);
    				},
    
    				onButtonTap: function(btn, e) {
    					var iCardSize = this.layout.getLayoutItems().length; 
    					for (var iCardIdx = iCardSize-1; iCardIdx >= 1; iCardIdx--) { 
    						this.remove(this.getComponent(iCardIdx));
    					}
    
    					var panel = new test.SubPanel({color: btn.text});
    					this.add(panel);
    					this.doLayout();
    					this.next();
    				}
    			});
    
    			test.SubPanel = Ext.extend(Ext.form.FormPanel, {
    				html: 'Card',
    				dockedItems: [{
    					xtype: 'toolbar',
    					dock: 'top',
    					title: 'Sub title'
    				}],
    
    				// @override
    				initComponent: function() {
    					this.html = this.html + this.color,
    					test.SubPanel.superclass.initComponent.call(this);
    				}
    			});
    			
    			Ext.setup({
    				tabletStartupScreen: 'resources/img/tablet_startup.png',
    				phoneStartupScreen: 'resources/img/phone_startup.png',
    				icon: 'resources/img/icon.png',
    				glossOnIcon: false,
    				
    				onReady: function() {
    					this.mainPanel = new test.MainPanel();
    				}
    			});
    		</script>
    </head>
    <body></body>
    </html>

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    I think you have hit this bug which is tracked and being worked on: http://www.sencha.com/forum/showthre...been-destroyed

  3. #3
    Sencha User Riaz's Avatar
    Join Date
    Sep 2010
    Location
    Sydney, Australia
    Posts
    183
    Vote Rating
    -1
    Riaz is an unknown quantity at this point

      0  

    Default


    is there any solution?

  4. #4
    Sencha User
    Join Date
    Apr 2011
    Location
    Brittany, France
    Posts
    82
    Vote Rating
    0
    jmclem is on a distinguished road

      0  

    Default


    Quote Originally Posted by Riaz View Post
    is there any solution?
    Yes: read the thread mentioned above.

    JM.

  5. #5
    Touch Premium Member
    Join Date
    Jun 2010
    Posts
    324
    Vote Rating
    2
    profunctional is on a distinguished road

      0  

    Default


    nm

Similar Threads

  1. Replies: 5
    Last Post: 29 Sep 2014, 1:02 AM
  2. Uncaught TypeError: Cannot read property 'length' of undefined
    By a2rdvark in forum Sencha Touch 1.x: Discussion
    Replies: 5
    Last Post: 23 Dec 2010, 3:48 PM
  3. Uncaught TypeError: Cannot call method 'indexOf' of undefined
    By cwebb in forum Sencha Touch 1.x: Discussion
    Replies: 11
    Last Post: 9 Sep 2010, 6:59 PM
  4. TypeError: Cannot read property 'parentNode' of undefined
    By zurdophp in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 2 Sep 2010, 5:58 AM
  5. Uncaught TypeError (JsonStore)
    By Johnnyger in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 2 Sep 2010, 1:12 AM

Thread Participants: 4