On Sun, Jul 6, 2008 at 9:46 PM, Jason Bunting <[EMAIL PROTECTED]> wrote: > > > I have this code in a control I have built: > > var ldel = this.LaborDataEntryList; > connect(this.ExpandCollapseButton, "onclick", function() { > toggleElementClass("Invisible", ldel); > }); > > What I originally tried to do was this: > > connect(this.ExpandCollapseButton, "onclick", partial(toggleElementClass, > "Invisible", this.LaborDataEntryList)); > > Problem is, when the event fires the result of the partial also gets the > additional event argument sent to it and it blows up within addElementClass > (which is called by toggleElementClass); is there anything that can be > reasonably done to prevent this from happening or do I need to accept that I > will have to write this code with the lambda?
You'll have to use the anonymous function, but if you find yourself doing it a lot you can always write your own higher order function that returns an appropriate anonymous function. -bob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~----------~----~----~----~------~----~------~--~---