PDA

View Full Version : Help with OnSelection



JasonMichael
4 Feb 2007, 11:11 AM
Hmm, all of this above looks great.... but I'll tell you what doesn't work for me, as was listed in an example:

sm.addListener('selectionchange', onSelection);

I've only been trying to get the remote paging grid example to work for about 3 days (literally as many hours in a day), and just finally got the grid to load my data last night (whoo hoooooooo!), and then I've always had to comment the above line out... finally, just now I did this after hacking and searching every single file for this 'onSelection', and finally rationalized it must be a browser specific function if its nowhere to be found in the YUI-EXT library of code:

sm.addListener('selectionchange', 'onSelection'); // notice the single quotes I had to add for this to work...... days later...... i'm dying here....

And after this, sure enough, the grid works again!!! didn't have to comment it out!!! Otherwise, Firefox and IE6 both complain that onSelection is not defined.... now I got that working, there's another related, and seeminly consequental, problem (of course!), but I'll save that for another area of this forum I guess.

tryanDLS
4 Feb 2007, 12:28 PM
Hmm, all of this above looks great.... but I'll tell you what doesn't work for me, as was listed in an example:

sm.addListener('selectionchange', onSelection);

I've only been trying to get the remote paging grid example to work for about 3 days (literally as many hours in a day), and just finally got the grid to load my data last night (whoo hoooooooo!), and then I've always had to comment the above line out... finally, just now I did this after hacking and searching every single file for this 'onSelection', and finally rationalized it must be a browser specific function if its nowhere to be found in the YUI-EXT library of code:

sm.addListener('selectionchange', 'onSelection'); // notice the single quotes I had to add for this to work...... days later...... i'm dying here....

And after this, sure enough, the grid works again!!! didn't have to comment it out!!! Otherwise, Firefox and IE6 both complain that onSelection is not defined.... now I got that working, there's another related, and seeminly consequental, problem (of course!), but I'll save that for another area of this forum I guess.


If you're still having issues with this, please post in the help forum. Let's keep this thread for discussion of the new syntax.

jack.slocum
4 Feb 2007, 2:15 PM
onSelection isn't a browser specific function, it must have been a function defined in the example.

With that code, you are attaching an event handler with the name onSelection. If you don't have a function with the name onSelection (and don't need to listen for it) just delete the line.

(by the way, I split this from the other post)

JasonMichael
5 Feb 2007, 12:34 AM
Okay, thanks folks. I figured it out. Yes, onSelection was supposed to be a function I needed to create. I got a clue from some code one of the regulars posted here, who had this function listed.