View Full Version : xtype: 'grid' in dockedItems is not working

17 Oct 2011, 8:18 AM

I have got a Panel (from Ext.grid.Panel) and in the dockedItems I try to use an xtype: 'grid'.

If I use 'panel' instead, there is no error message. If I use 'grid' on the same xtype, there is the message 'component is undefind'

Ext.define('my.view.vPanel', {
extend: 'Ext.grid.GridPanel'
, dockedItems: [{
xtype: 'grid'
, columns: ['name', ...]

I like to create a summary row between a grid. I created it in an mvc.


17 Oct 2011, 9:40 AM
try 'gridpanel' as the xtype.

17 Oct 2011, 11:35 AM
sorry, it's still the same: component is undefined

17 Oct 2011, 1:53 PM
Just tried it myself, 4.0.2 and 4.0.6. Worked fine.

Which browsers are you seeing this in? If it's just IE then I bet it's a stray comma.

If it's happening in all browsers then I'd suggest trying to render that docked grid outside of the docked items. I suspect you'll find it's a problem with the grid config rather than docking.

17 Oct 2011, 2:16 PM
Hi, I am using FireFox and Safari. In Safari the text ist a little bit differente but it says the same: TypeError: 'undefined' is not an object (evaluating 'component.xtype')

How can I render that outsite. I try to have these grid as an seperate row on the end of an other grid. To use these place with a toolbar it's working fine, and if I declarate it as panel it's also working fine. What should be the problem that a grid is undefined.

In a different arrangement where I don't use mvc it's also working fine. So maybe I have a problem with my mvc.

My problem is I don't understand why panel should be defined and a grid and gridpanel not.

I tryed also to create a varible of a grid and declarate an alias: widget.nameofgrid and liked to use xtype: nameofgrid - the same.

17 Oct 2011, 2:45 PM
How can I render that outsite.

This is purely for diagnostic purposes. Ignore all the rest of your code, just grab the config for that grid and instantiate it using Ext.create. Shove in a renderTo: Ext.getBody() and a width and height if you don't have them already. The key thing is whether or not the config works outside of the docked items.

The full stacktrace from Firebug would be very helpful. Also, which ExtJS version are you using?

The line that's blowing up is in Ext.Component.create. It seems that component is undefined. Given everything you've described, this suggests that there's a problem with your grid config (possibly the columns?). The reason panel works fine is because it uses different config options so a mistake in, for example, the columns wouldn't affect it.

So far the only way I've managed to reproduce this error message is by adding a load of stray commas into the dockedItems array. However, that would also fail with a panel. Can you just check all your arrays are fine and you don't have any doubled or stray commas?

17 Oct 2011, 11:53 PM
Hi skirtle,

thank you to gave me new idears. I got it, my header for the grid was wrong. Now I have a grid in the dockedItems.

Thank you.