1

I'm using ExtJS and GeoExt inside a Symfony application. After some troubles caused by wrong routing due to the assets dumping of Symfony, everything is working fine at the moment.

After finding a problem when trying to display layers of OpenLayers inside an Ext Panel, I tried to solved it this way :

Ext.require([
  'GeoExt.panel.Map',
  'GeoExt.tree.OverlayLayerContainer',
  'GeoExt.tree.BaseLayerContainer',
  'GeoExt.data.LayerTreeModel',
  'GeoExt.tree.View',
  'GeoExt.tree.Column',
]);

Problem, I got this error:

 Uncaught TypeError: undefined is not a function 

The error is coming from the Ext.Require
If I just put

Ext.require([
]);

with nothing inside, no error. As soon as I put something inside, even if it's a Ext.something, the error shows up again.

The error is coming from :

/server path/ExtJS4.2/src/menu/Manager.js:182

Why ?

Lorenz Meyer
  • 19,166
  • 22
  • 75
  • 121
  • Are each of the "classes" you're requiring (e.g., `GeoExt.panel.Map`, etc.) defined? – Kelsey Francis Dec 13 '13 at 14:20
  • Incidentally, you have a trailing comma at the end of the array you're passing to `require`. – Kelsey Francis Dec 13 '13 at 14:20
  • @KelseyFrancis You mean the comma at the end of Column', ? It's working in another code I made. Changes nothing if I remove it. –  Dec 13 '13 at 14:27
  • @KelseyFrancis I don't know if they are defined, but I guess yes because I can use them in my code and they work. Anyway, if I just pass Ext.container.Viewport, I got the same error even if I use an Ext.create(Ext.container.Viewport inside my code and it's working. –  Dec 13 '13 at 14:28
  • The problem is coming from 'GeoExt.data.LayerTreeModel', that's why I try to define it into the require. Because defined as model, it seems to be simply ignored by the code. But the 'GeoExt.panel.Map' is already working in the code. So it's kinda strange. –  Dec 13 '13 at 14:31

1 Answers1

2

Found the reason, I was using

ext-debug.js

Switched to

 ext-all.js

and the error is gone.
My function are still not working tho, but it wasn't the theme of my question.