PDA

View Full Version : Help with this error in IE



dias
11 Apr 2010, 2:05 PM
Hello,

I have this bit of code that causes me an error in IE, in FF everything is fine.



PanelAnnotation = function(){
var self = this; //Closure

var storeDataView = new Ext.data.JsonStore({
baseParams:{id: 0, action: 'loadAnnotation'}
,url: 'files/manageAnnotations.php'
,autoLoad: true
,root: 'results'
,totalProperty: 'total'
,id: 'dataviewAnnotationStore'
,fields: [
{name:'id', type: 'integer'},
{name:'titulo', type: 'string'},
{name:'descricao', type: 'string'},
{name:'data', type:'date'},
{name: 'nome',type: 'string'}
]
,sortInfo:{field: 'id', direction: "DESC"}
});

var tpl = new Ext.XTemplate(
'<tpl for=".">',
'<div id="dataViewAnnotation">',
'<b>{titulo}</b><br/>',
'por <span class="author">{nome}</span> em {data}',
'<div class="description" id="{descricao}">{descricao}</div></div>',
'</tpl>',
'<div class="x-clear"></div>'
);

var dataView = new Ext.DataView({
id: 'annotationDataView',
store: storeDataView,
tpl: tpl,
loadingText: 'A Carregar..',
loadMask: true,
autoHeight: false,
height: 157,
autoScroll: true,
multiSelect: false,
style: {
background: '#DEDCDC',
padding: '7px'
},
emptyText: 'Sem anotação'
});

PanelAnnotation.superclass.constructor.call(this,{
annotationId: 0,
store: storeDataView,
id: 'PanelAnnotation',
title: 'Anotação',
iconCls: 'windowsToolBar24Sprite annotation-wt-icon-24',
items:[dataView],
listeners: {
collapse: function(p){
var index = parseInt(p.ownerCt.items.indexOfKey(this.id),10);
var pnl = null;

if(index+1 === p.ownerCt.items.length){
pnl = p.ownerCt.get(0);
}else{
pnl = p.ownerCt.get(index+1);
}
pnl.expand();
}
}
});
};
Ext.extend(PanelAnnotation, Ext.Panel,{
setAnnotationId: function(id){
this.annotationId = id;
this.store.baseParams.id = this.annotationId;
},
reload: function(){
this.store.reload();
},
load: function(){
this.store.load();
}
});

PanelInsertRevision = function(){
PanelInsertRevision.superclass.constructor.call(this,{
annotationId: 0,
id: 'PanelInsertRevision',
bubbleEvents: ['insertRevision'],
title: 'Inserir Revisão',
layout: 'fit',
iconCls: 'windowsToolBar24Sprite revision-wt-icon-24',
listeners: {
collapse: function(p){
var index = parseInt(p.ownerCt.items.indexOfKey(this.id),10);
var pnl = null;

if(index+1 === p.ownerCt.items.length){
pnl = p.ownerCt.get(0);
}else{
pnl = p.ownerCt.get(index+1);
}
pnl.expand();
}
}
});
};
Ext.extend(PanelInsertRevision, Ext.Panel,{
setAnnotationId: function(id){
this.annotationId = id;
}
});

winAnnotation = function(id){
var pAnnotation = new PanelAnnotation();
pAnnotation.setAnnotationId(id);
pAnnotation.load();

var gRevision = new gridRevision();
gRevision.setAnnotationId(id);
gRevision.load();

pAnnotation.add(gRevision);

var pInsertRevision = new PanelInsertRevision();

winAnnotation.superclass.constructor.call(this,{
panelAnnotation: pAnnotation,
panelRevision: pInsertRevision,
gridRevision: gRevision,
id: 'winAnnotation'
,title: 'Gestão de Anotação'
,height: 425
,width: 615
,layout:'accordion'
,closable: true
,resizable: false
,plain: true
,border: false
,constrain: true
,closeAction: 'close'
,modal: true
,layoutConfig:{
animate: true
}
,items: [pAnnotation, pInsertRevision]
});

this.on('insertRevision', function(t){
this.gridRevision.reload();
});
};
Ext.extend(winAnnotation, Ext.Window);



If i remove PanelAnnotation from winAnnotation... no error in IE.
If i don't load the storeDataView... no error in IE.

I think the error is probably in storeDataView for the loading of the DataView, in the load.

The error i catch, using ext-all-debug.js is in line 1450 from ext-all-debug.js, in the function jsSelect, var paths.

'Undefined' is null or not an object... is the error..

This occurs only in IE, i'm using version 8.

Probably I will be making something wrong that can not see. Maybe someone can help me solve this problem.

Thanks in advance,

Paulo

dias
11 Apr 2010, 2:53 PM
Hello,

I solve the problem...

It was my mistake, should have read better the API ... the problem was the property itemSelector ... not defenide in the code.

Thanks,

Paulo