Results 1 to 3 of 3

Thread: Unknown runtime error in Internet Explorer

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    6

    Default Unknown runtime error in Internet Explorer

    Hi I am getting this error in Internet Explorer 8. This work fine in all the browser, except in Internet Explorer 8.
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)
    Timestamp: Thu, 16 Aug 2012 15:14:46 UTC
    Message: Unknown runtime error

    The code is this
    Code:
     
    Ext.onReady(function(){
    
    
    var getGrid = function()
    {
    	Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
    	var Data=[['1']];
    	var store = new Ext.data.SimpleStore({
    		 fields: [
    			{name: 'Numero_Cajon'}
    		]	
    	});	
    	
    	store.loadData(Data);
    	return new Ext.grid.GridPanel({
            store: store,	
    		columns: 
    		[{
    			id:'numero_cajon',
    			header: "Cajon", 
    			sortable: true,
    			width: 65,
    			dataIndex: 'Numero_Cajon'
    		}],
    		stripeRows: true,
            autoHeight:true,
            viewConfig: {
            	autoFill:true
            }
    	});	
    }
    	
    
    
    var getPanelPrincipal = function()
    {
    	return new Ext.FormPanel({
    	    bodyPadding: 10,
    		renderTo: document.body,
    		frame: true,
    		height: 458,
        	width: 280,
    		id : Ext.id(),
        	bodyPadding: 10, 
    		cls: 'xpanelBack',
    		backgroundcolor: '#00CC99',
    		items: [
    		{
    			xtype: 'textfield',
                border: 'solid',
    			fieldLabel: 'Module',
                value: 'MOD002',
    			width: 180,
     			readOnly: true,
    			labelStyle: 'font-weight: bold;font-size: 14px;',
    			cls: 'x2',
    			anchor: '100%'
            },
    		getGrid()
    		]
    	});
    }
    
    
    	var superPanel=new Ext.FormPanel({
    		renderTo: document.body,
    		id : 'superPanel',
    		items:[
    			getPanelPrincipal()
    			//getPanelPrincipal()
    		]
    	});
    });

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410

    Default

    I made the following changes and it loads without error. Please note the changes:

    Code:
    Ext.onReady(function() {
    
    	var getGrid = function() {
    		Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
    		var Data = [
    			['1']
    		];
    		var store = new Ext.data.SimpleStore({
    			fields: [{
    				name: 'Numero_Cajon'
    			}]
    		});
    
    		store.loadData(Data);
    		return new Ext.grid.GridPanel({
    			store: store,
    			columns: [{
    //				id: 'numero_cajon', // removed id, bad practice, use itemID
    				header: "Cajon",
    				sortable: true,
    				width: 65,
    				dataIndex: 'Numero_Cajon'
    			}],
    			stripeRows: true,
    			autoHeight: true,
    			viewConfig: {
    				autoFill: true
    			}
    		});
    	}
    
    
    
    	var getPanelPrincipal = function() {
    		return new Ext.FormPanel({
    			bodyPadding: 10,
    //			renderTo: document.body, // you already have this in main for, below
    			frame: true,
    //			height: 458, // not needed, parent decides, uses fit
    //			width: 280, // not needed, parent decides, uses fit
    //			id: Ext.id(), // removed id, bad practice, use itemID .. Ext.id(). id's are auto generated if left alone
    //			bodyPadding: 10, // duplicate
    			cls: 'xpanelBack',
    //			backgroundcolor: '#00CC99', // should be backgroundColor; case sensitive
    			items: [{
    				xtype: 'textfield',
    				border: 'solid',
    				fieldLabel: 'Module',
    				value: 'MOD002',
    				width: 180,
    				readOnly: true,
    				labelStyle: 'font-weight: bold;font-size: 14px;',
    				cls: 'x2',
    				anchor: '100%'
    			},
    			getGrid()]
    		});
    	}
    
    
    	var superPanel = new Ext.FormPanel({
    			height: 458, // missing  
    			width: 280, // missing 
    			layout: 'fit', // no layout; most likely cause of error, bad layout
    		renderTo: document.body,
    //		id: 'superPanel',  // removed id, bad practice, use itemID
    		items: [ getPanelPrincipal ]
    	});
    });
    Scott.

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    6

    Default Problem

    Hi, it still doesn't work.
    In my version I have the function getPanelPrincipal() for calling it several times.
    Here is a screen shot of how it looks.The grid is not getting the information.
    In the code you told me right now. I don't get the error, but I am calling getPanelPrincipal as an object, and not as function if do it that way. I am getting the same error.

    Thanks for your time.

    version1x.png
    Code:
    Ext.onReady(function(){
    
    
    
    
    var getGrid = function()
    {
    	Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
    	var Data=[['1']];
    	var store = new Ext.data.SimpleStore({
    		 fields: [
    			{name: 'Numero_Cajon'}
    		]	
    	});	
    	
    	store.loadData(Data);
    	return new Ext.grid.GridPanel({
            store: store,	
    		columns: 
    		[{
    			id:'numero_cajon',
    			header: "Cajon", 
    			sortable: true,
    			width: 65,
    			dataIndex: 'Numero_Cajon'
    		}],
    		stripeRows: true,
            autoHeight:true,
            viewConfig: {
            	autoFill:true
            }
    	});	
    }
    	
    
    
    
    
    var getPanelPrincipal = function()
    {
    	return new Ext.FormPanel({
    	    bodyPadding: 10,
    		renderTo: document.body,
    		frame: true,
    		height: 458,
        	width: 280,
    		id : Ext.id(),
        	bodyPadding: 10, 
    		items: [
    		{
    			xtype: 'textfield',
                border: 'solid',
    			fieldLabel: 'Module',
                value: 'MOD002',
    			width: 180,
     			readOnly: true,
    			labelStyle: 'font-weight: bold;font-size: 14px;',
    			cls: 'x2',
    			anchor: '100%'
            },
    		getGrid()
    		]
    	});
    }
    
    
    
    
    	var superPanel=new Ext.FormPanel({
    		renderTo: document.body,
    		layout: {
            type: 'column'
        	},
    		items:[
    			getPanelPrincipal(),
    			getPanelPrincipal(),
    			getPanelPrincipal()
    		]
    	});
    });

Posting Permissions

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