1

Does anyone know if there are any known issues subscribing to events fired by a YUI2 DataTable when using with YUI3 2in3? I'm trying to do the following and it's not working:

myDataTable.subscribe("initEvent", function(){
   Y.log('******** hello from initEvent');
});   

Other features of the DataTable seem to be working but I can't seem to tap into any events.

Does anyone else have issues with this? Any suggestions?

Thanks,
Bart

skaffman
  • 398,947
  • 96
  • 818
  • 769
Bart Gottschalk
  • 174
  • 2
  • 11

2 Answers2

0

Bart,

http://ericmiraglia.com/yui/demos/2in3dt.php

Subscribing to the init event and the row click event seems to work using your syntax above. Is there something different about your implementation? Or perhaps the init event has already fired at the point where you're listening for it?

-Eric

Eric Miraglia
  • 1,209
  • 8
  • 9
  • Eric, I ended up getting an answer to this issue on the YUI Library forum. The answer is here. http://yuilibrary.com/forum/viewtopic.php?f=92&t=4339 I needed to use myDataTable.on("initEvent", ... rather than myDataTable.subscribe("initEvent", ... With this change things are working. Does that make sense to you that I would need to listen to a YUI3 event rather than a YUI2 event? Bart – Bart Gottschalk Jul 28 '10 at 21:08
  • Bart, No, that doesn't make sense to me. "on" is just an alias to "subscribe", so you're not switching to a YUI 3 event in that case. And in the example I' linked to above, http://ericmiraglia.com/yui/demos/2in3dt.php, I'm using subscribe, and it works fine there. -Eric – Eric Miraglia Jul 30 '10 at 18:26
0

Sanity check: is the YUI2 event module loaded? Also, try loading the YUI2 logger, and make sure you are referencing the debug version of the scripts. The output is verbose, but usually shows where the problem is.

Gabe Moothart
  • 31,211
  • 14
  • 77
  • 99
  • Gabe, Using YUI 2 in 3, Bart shouldn't have to worry about whether YUI 2 Event or other DT dependencies are loaded -- that should be happening for him automatically. Cf: http://www.yuiblog.com/blog/2010/03/11/yui-2-in-3-coming-soon/ -Eric – Eric Miraglia Jul 24 '10 at 00:58