PDA

View Full Version : Creating a GridPanel throws "this.addEvents is not a function" error



Dumas
3 Mar 2010, 10:30 AM
Hi!

I have a problem when creating a new GridPanel. It seems very trivial, but I don't get it :-/

When I create a new GridPanel with the code below I get following error;
"TypeError: this.addEvents is not a function "
The error is thrown in the Ext.Component when this.addEvents(...someEvents...); is called

My code is just

var grid = Ext.grid.GridPanel({
title: 'title',
store: store,
columns: [{
header: 'header',
dataIndex: 'name'
}]
});

Any ideas?

thx!
Dumas

Animal
3 Mar 2010, 10:39 AM
Same as whenever this question is raised here (as you would find if you searched)

You forgot "new"

Dumas
3 Mar 2010, 11:28 AM
Oh sry, to stupid mistake right after each other, what a shame :">

VinylFox
3 Mar 2010, 11:41 AM
I put together a blog post on these common errors not too long ago....might help.

http://www.vinylfox.com/some-common-extjs-error-messages-explained/