-
17 Oct 2011 8:18 AM #1
Answered: xtype: 'grid' in dockedItems is not working
Answered: xtype: 'grid' in dockedItems is not working
Hi,
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'
I like to create a summary row between a grid. I created it in an mvc.Code:Ext.define('my.view.vPanel', { extend: 'Ext.grid.GridPanel' ... , dockedItems: [{ xtype: 'grid' , columns: ['name', ...] ... }] ...
regards
Lars
-
Best Answer Posted by skirtleThis 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.How can I render that outsite.
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 9:40 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
try 'gridpanel' as the xtype.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
17 Oct 2011 11:35 AM #3
sorry, it's still the same: component is undefined
-
17 Oct 2011 1:53 PM #4
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 #5
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 #6
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.How can I render that outsite.
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 #7
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.


Reply With Quote