Thanks for the contribution Daniel here's a few comments:

1. This will leak in IE. Take a look at  your chainTo function. Each time
you call it you create each of the functions that you're merging with
options.request. Since some of the functions reference the element, IE
would keep that reference and when you close the page it will not release
the reference. That's a memory leak.

2. You're also adding a new addEvent('change') each time chainTo is called.
Try this: chainTo().chainTo(); // and change the select. You should get two
Requests. Instead you should this.retrieve('chainTo:request'). If not set,
then lazy load it. If they're new options, then just pass the options in
the send method of the Request.

3. You're not taking advantage of OO practices. I'd make a another class
that either composes a Request.JSON or extends Request.JSON.



On Wed, Nov 30, 2011 at 11:02 PM, Daniel Antonio Peraza Cedrez <
danielper...@gmail.com> wrote:

> Hi, I was looking for a chained select boxes plugin into the forge, but I
> wasn't able to find one, so I wrote a simple function to extend Element.
> Here is the fiddle: http://jsfiddle.net/enTsg/
>
> Please give me some feedback on how can I improve it. At first sight, the
> only problem I see it's some interface bloating. May be I could simplify it
> a bit.

Reply via email to