[ 3 posts ]

J. Shirley

YUI Contributor

  • Username: jshirley
  • Joined: Mon Sep 19, 2011 8:41 am
  • Posts: 12
  • GitHub: jshirley
  • Gists: jshirley
  • IRC: jshirley
  • Offline
  • Profile

yui.js error when integrating custom DataTableScroll module.

Post Posted: Tue Sep 20, 2011 9:34 am
+0-
I've introduced a patch for DataTableScroll, but in trying to integrate it and get it ready for a gallery-based I can't get it working.

I've setup a fiddle here:
http://jsfiddle.net/jshirley/SRRaa/2/

The arg.toString() coming from the anon function in Y.cache is confusing me. I'm not sure why that would be undef, or where exactly I've gone off the rails.

The patched file is at http://j.shirley.im/static/yui3/build/d ... l-debug.js

This error is fired when the .render() method is called. If there is a dt.after('render', function() { ... }) listener attached, it is never fired (which is what is blocking me for the time being).

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: yui.js error when integrating custom DataTableScroll mod

Post Posted: Tue Sep 20, 2011 12:54 pm
+0-
I can't imagine why are you using Y.cached, it serves no purpose on functions that don't accept arguments. If a function takes no arguments or if the function being cached my change the value returned based on other factors but the arguments themselves, Y.cached serves no purpose.

In this case, you are just as well calculating the value and storing it. Your cached function gets executed just once, when the module is initially loaded so it won't be recalculated. Y.cached might be confused by the lack of arguments to use as a key to fetch the calculated value.

Anyway, since you don't really need Y.cached, it doesn't matter why it fails.

J. Shirley

YUI Contributor

  • Username: jshirley
  • Joined: Mon Sep 19, 2011 8:41 am
  • Posts: 12
  • GitHub: jshirley
  • Gists: jshirley
  • IRC: jshirley
  • Offline
  • Profile

Re: yui.js error when integrating custom DataTableScroll mod

Post Posted: Wed Sep 21, 2011 4:15 am
+0-
It does matter why it fails, because it blocks any events on render.

I guess my patch will also include completely removing the call to Y.cached. To be clear, the DataTableScroll plugin is what is in 3.4.0, I've just fixed some of the width calculation methods (as you can see, it's not working in the fiddle because of the error)
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum