selectionAdded and selectionRemoved should return the item added/removed

Johnas's Avatar

Johnas

02 Apr, 2011 05:50 PM

Hello,

It seems that the "selectionAdded" and "selectionRemoved" callbacks do not receive the item being added or removed. Instead, the autosuggest element is received, which is not useful. Below is an example to verify this, which requires the JSON library to be loaded.

$j("#auto").autoSuggest(data,{

neverSubmit:true,
selectionAdded:function(obj){
    alert(JSON.stringify(obj)); //You will see that the object received is not the item added
},
selectionRemoved:function(obj){
    alert(JSON.stringify(obj)); //You will see that the object received is not the item removed
}

});

Thank you very much!

  1. 1 Posted by Johnas on 02 Apr, 2011 06:19 PM

    Johnas's Avatar

    Actually I'm wrong. The obj received matches with the element added or removed, but it just contains the text of that element, not the value associated with it. This would be a great addition.

    Thanks!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac