At.js icon indicating copy to clipboard operation
At.js copied to clipboard

inserted.atwho not returning $li

Open danielolivasjr opened this issue 9 years ago • 5 comments

When I use the inserted.atwho event like this, how can I get the chosen item from the popup? According to your documentation, the $li var should contain the chosen item, but I'm not sure how to use it.

$inputor.on("matched.atwho", function(event, flag, query) { console.log(event, "matched " + flag + " and the result is " + query); });

inserted.atwho

Triggered after user choose a popup item in any way. It would receive these arguments:

atwho event - jQueryEvent : Just a jQuery Event. $li - jQuery Object : List Item which have been chosen browser event - jQueryEvent : real browser event

danielolivasjr avatar Dec 13 '16 20:12 danielolivasjr

@danielolivasjr

Lucifer0601 avatar Jun 08 '17 14:06 Lucifer0601

@myabc this is my issue

Lucifer0601 avatar Jun 08 '17 14:06 Lucifer0601

@danielolivasjr You can use inserted.atwho event like this:

$inputor.on("inserted.atwho", function(event, $li, browser_event) {
    console.log(event, "inserted " + $li + " and the result is " + browser_event);
});

nersoh avatar Jun 29 '17 13:06 nersoh

@nersoh how you can get itemData from $li?

albertShake avatar Feb 19 '18 21:02 albertShake

@albertShake you can do that by getting itemData from $li: $li.data('item-data')

Hope it helps you!

nersoh avatar Feb 21 '18 18:02 nersoh