当前位置: 首页 > 文档资料 > At.js 开发文档 >

方法函数

优质
小牛编辑
139浏览
2023-12-01

All At.js events are normal jQuery events. You can bind them in the jQuery way:

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

If you have configured alias setting, the event name would be added a suffix.
Suppose your alias setting is at-mentions, so that the event name would be: matched-at-mentions.atwho

And, all event's context is the controller object.

matched.atwho

Triggered after match a word. It would receive these arguments:

  • event - jQuery Event : Just a jQuery Event|
  • flag - String : the at char
  • query - String : Query String

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

reposition.atwho

Triggered after reposition popup . It would receive these arguments:

  • event - jQueryEvent: Just a jQuery Event.
  • offset - Hash : Offset after reposition.Used to .offset jQuery method, the structure looks like it: {left:x, top: y}

beforeDestroy.atwho

Triggered before destroy plugin. There is no arguments for it.

shown.atwho

triggered after view shown

  • event - jQueryEvent : Just a jQuery Event.

hidden.atwho

triggered after view hidden

  • event - jQueryEvent : Just a jQuery Event.