PDA

View Full Version : Desktop open close error



nar
10 Nov 2009, 12:35 PM
I am currently building a desktop based app and am running into a problem. When opening a bar chart, closing then reopening I receive no errors and all functions preform as expected. However, if I open my grid close my grid and reopen I am getting a javascript error.

Error:


Message: Object required
Line: 2183
Char: 824
Code: 0

Code:


MyDesktop.module = Ext.extend(Ext.app.Module, {
init : function(){
this.launcher = {
text: 'Applications',
handler: function() {
return false;
},
menu: {
items: [{
text: 'Reporting',
menu: {
items:[{
text: 'Bar Graph',
handler: function(src){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('barGraph');
if(!win){
var store = new Ext.data.JsonStore({
url: 'url',
root: 'rows',
nocache: true,
fields: [
'date',
'hours'
]
});
store.load();
win = desktop.createWindow({
title: 'Bar Graph',
id: 'barGraph',
width:500,
height:300,
layout:'fit',
shim:false,
animCollapse:false,
constrainHeader:true,
items: {
xtype: 'barchart',
store: store,
yField: 'date',
xField: 'hours'
}
});
}
win.show();
},
scope: this
}]
}
},{
text: 'Grid',
menu: {
items:[{
text: 'Grid',
handler: function(src){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('grid');
if(!win){
var store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
api: {
read: 'url',
update: 'url'
}
}),
reader: new Ext.data.JsonReader({
successProperty: 'success',
idProperty: 'id',
root: 'rows'
},
[
{name: 'id'},
{name: 'name'}
]
),
writer: new Ext.data.JsonWriter({
encode: true,
writeAllFields: false
}),
autoSave: true
});
store.load();
win = desktop.createWindow({
id: 'grid',
title:'Grid',
width:740,
height:480,
iconCls: 'icon-grid',
shim:false,
animCollapse:false,
constrainHeader:true,
layout: 'fit',
items: {
xtype: 'editorgrid',
ds: store,
cm: new Ext.grid.ColumnModel([
{header: "id", id: "id", dataIndex: 'id'},
{header: "Name", sortable: false, dataIndex: 'name', editor: new Ext.form.TextField({allowBlank: false})}
])
}
});
}
win.show();
},
scope: this
}]
}
}]
}
}
}
});

nar
11 Nov 2009, 7:17 AM
Still cannot get this one figured out, the error in firebug:



+s is null
anonymous()ext-all.js (line 2183)
anonymous(Object typeAhead=true triggerAction=all)ext-all.js (line 1046)
anonymous()ext-base.js (line 14)
anonymous()ext-base.js (line 14)
anonymous()ext-base.js (line 14)
anonymous()ext-base.js (line 14)
anonymous()ext-base.js (line 14)
anonymous(Object initialConfig=Object text=Grid)index.cgi (line 448)
anonymous(Object scope=Object options=Object)ext-all.js (line 147)
anonymous([Object scope=Object options=Object 0=Object], function(), Object name=scope)ext-base.js (line 23)
anonymous()ext-all.js (line 147)
anonymous()ext-all.js (line 136)
anonymous(Object browserEvent=Event mouseout button=0 type=mouseout)ext-all.js (line 2053)
anonymous(Object browserEvent=Event mouseout button=0 type=mouseout)ext-all.js (line 2009)
h(Object browserEvent=Event mouseout button=0 type=mouseout)ext-all.js (line 171)
[Break on this error] Ext.form.ComboBox=Ext.extend(Ext.form.Tr...is.hiddenName){this.hiddenName=s.name;}\next-all.js (line 2183

nar
11 Nov 2009, 8:56 AM
I was able to narrow this down more, in the code posted above I removed a few columns from the grid (as this grid as tons of columns and I was trying not to junk up code), so the grid above works. When I add another row to the cm that contains a combo box I get the error on open close open.



{header: "Type", sortable: false, dataIndex: 'type', editor: new Ext.form.ComboBox({typeAhead: true, triggerAction: 'all', transform:'type', lazyRender: true, listClass: 'x-combo-list-small'}), width: 150},


So this looks to be something specific to the combo box in the desktop grid window. I tested the exsistance of the div element "type" before I loaded the grid both times. First time I load the grid the div exsist, I close the grid and reopen. The div does not exsist. Why would this be destroyed? It is not part of the grid.