It would be quite useful to have option-remove/-added events when user remove item from multiselect. I've added the patch for this.

CommentFileSizeAuthor
multiselect.js_.patch960 bytesdesunit

Comments

attheshow’s picture

Status: Active » Postponed (maintainer needs more info)

Can you give an example of how this might be beneficial to users?

desunit’s picture

Sure. I have 2 multiselect controls one is depend on another. Once I've added item I need to refresh another multiselect control. Without add/remove event I just can't do this.

I think everybody could benefit from it since notification about events is a crucial part in a widget.

desunit’s picture

Status: Postponed (maintainer needs more info) » Active
attheshow’s picture

Status: Active » Needs work

Looking at the jQuery docs (http://docs.jquery.com/Events/triggerHandler), I don't think you need to have brackets around the variable names "option" and "anOption" right? Have you tested this to make sure it functions correctly?

desunit’s picture

Status: Active » Needs work

Of course, I tested it. If you take a look closer on triggerHandler you will notice that the second argument actually is an Array and array could be represented in JS with brackets:

triggerHandler("event", [data]);
desunit’s picture

Status: Needs work » Active
attheshow’s picture

Status: Needs work » Active

Generally, brackets are used to indicate that certain parameters in function calls are optional. The brackets aren't meant to actually be present when the parameter is used in a function call. See another example of this at http://docs.jquery.com/Effects/show#speedcallback where "callback" is actually the name of a function and not an array.

attheshow’s picture

Assigned: Unassigned » attheshow
Status: Active » Fixed

Committed to dev version.

desunit’s picture

Well, it's absolutely different example with a callback function. There is great benefit in passing array - you could easily add new passing without consumer application changes. Anyway, I'm glad that you committed it (even partly). Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.