PDA

View Full Version : Unknown runtime error in Internet Explorer



dicetog
16 Aug 2012, 7:26 AM
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



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()
]
});
});

scottmartin
16 Aug 2012, 8:30 AM
I made the following changes and it loads without error. Please note the changes:



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.

dicetog
16 Aug 2012, 9:06 AM
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.

38011


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()
]
});
});