Reputation: 11301
I'm trying to figure out how layers in Ext work. The documentation is very concise and I can't find a lot about them anywhere else, other than a forum thread where Jack Slocum says they're very simple.
I have a working tree panel, and what I'm now trying to do is put that in a layer so it floats over the page (it's meant as a helper dialog that pops up next to a form element). I've only gotten as far as creating a simple layer with a <div>
element in it, but can't get it to contain more advanced stuff. Looking at the Combo source, which uses a Layer for the option list, also didn't make me much wiser.
So, can someone with a little more experience on this subject please tell me: how are you really supposed to use Ext.Layer? Or am I "doing it wrong"? :)
Upvotes: 2
Views: 731
Reputation: 13505
An Ext.Layer
is an extension of Ext.element
, rather than being an extension of Ext.Component
.
Ext.Element
doesn't benefit from all the component config options and methods that say an Ext.Panel
does, and so you're going to have a much harder time adding a tree panel to an Ext.Layer
than if you added the tree panel to an Ext.Window
which already benefits from shim and shadow (the two main reasons you would want to use an Ext.Layer
).
But before I would resort to using Ext.Window
to wrap the tree panel, I would take a look at the shadow config option in tree panel which should provide the 'floating' effect you want...
true (or a valid Ext.Shadow Ext.Shadow.mode value) to display a shadow behind the panel, false to display no shadow (defaults to 'sides'). Note that this option only applies when floating = true.
Upvotes: 2