PDA

View Full Version : Error when closing the window



Mogaba
28 Dec 2009, 6:16 AM
Hello,
I'm trying to close the window with the grid when grid's rowdblclick event is fired. Here is the code:


var memRegGrid = new Ext.grid.GridPanel({
id: "memRegGrid",
/* code */
listeners: {
rowdblclick: function () {
/* code */
Ext.getCmp("regWindow").close();
}
}
});

var regWindow = new Ext.Window({
id: "regWindow",
items: memRegGrid
}); It works but Firebug shows an error:

this.view is null
this.view.processEvent(name, e);

This function is called in the processEvent function of the GridPanel class but in the GridView class the processEvent function is declared as Ext.emptyFn.

My questions are:
1) What for is this empty function?
2) Should I use another way to close the window? Can I just override processEvent method in the GridPanel so that it does not call this.view.processEvent?

Condor
28 Dec 2009, 6:23 AM
You can't destroy the grid in a rowdblclick event handler.

You should delay the event with:

rowdblclick: {
fn: function () {
/* code */
Ext.getCmp("regWindow").close();
},
delay: 10
}

Mogaba
28 Dec 2009, 7:42 AM
It works, thank you.