I just found YUI and Ext-Js and read they could be mixed together if you use a YUI "adapter". So after following the basic instructions of library ordering, I set about on a fairly naive quest to embed a YUI drag and drop demo into a window of Ext-Js's Web Desktop .
Amazingly what I did worked. I simply took the global variables (slots, players, Event, DDM) and made them members of the created window object. I then substituted the HTML of the drag and drop space "<div id="workarea">..blahblah...</div>" for the "<p>something useful would be in here</p>" that was in the default for blank windows in the ext-js sample. Suddenly I could drag and drop constrained squares inside a window alongside the ExtJs "Grid Window" and "Accordion Window"! I was shocked.
But I use Firebug with the "Break on all Errors" option. And clicking in the ExtJs grid window now causes me to temporarily halt in YUI's connection-debug.js on line 240. It's a little snip of code in _hasSubmitListener enclosed within a try/catch block, like so:
237 try
238 {
239 var obj = YAHOO.util.Event.getTarget(e);
240 if(obj.type.toLowerCase() == 'submit'){
241 YAHOO.util.Connect._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
242 }
243 }
244 catch(e){}
What's happening is that obj is div.x-grid3-cell-inner, and its .type is undefined. Of course if I just ignore this, the program runs along smoothly because the error is "caught" by the try/catch block. But if type being undefined is one of the conditions that one is to expect and is normal, I'd rather it be handled explicitly so it didn't get Firebug to break on it as an error:
if (obj.type != undefined)
if (obj.type.toLowerCase() == 'submit') ...
However if this is truly a condition that should never occur if I'm mixing the frameworks properly (e.g. any time this method is run one should expect the obj to have a type), I'd appreciate any pointers to where I should look to do it right. And also if that's the case, it would seem the obj.type.toLowerCase() should be moved outside of the try/catch so that people who aren't using Firebug can know they've got an error in their code!
Thanks much,
HF.