Recap of Version 0.2If you quickly go back and play with the demo in my previous blog you'll find that you can't drag anything on the fourth, green quadrant. This is simply because it is not enabled by (the presence of) the mixin. You'll also find that both the
TitleWindowcan be dropped on to the nested purple region.
Introducing Drop FilteringWith version 0.3 you can now specify an inclusion filter that restricts what can and can't be dropped on to the corresponding drop-target. Have a play with this demo of version 0.3: You'll notice 2 differences:
- The fourth quadrant now accepts the nested purple region, but not the
- The nested purple region now only accepts
TitleWindows, but not
How It Works... In BriefThe
dndFilterproperty is of type
Array. It expects an array of types i.e. the types of thing to include/allow to be dropped e.g.
TitleWindow. If the
dndFilterproperty is not specified at all, or is later assigned
null, then this is treated as include/allow all types, as in wildcard semantics. That's it really. Visit the DnDMixin's homepage for more details and references to source code.