jQueryUI Autocompelete事件Event详解

  • create

    Type:
    autocompletecreate

    This event is triggered when autocomplete is created.

此事件在autocomplete创建时触发
此事件在按照source属性配置的请求发出前,在输入满足minLength和delay属性约束后触发。此事件可以通过返回false值取消,这样就不会发出request请求且没有自动的提示出现。
  • open

    Type:
    autocompleteopen

    Triggered when the suggestion menu is opened.

此事件在自动提示的菜单打开时触发。
  • focus

    Type:
    autocompletefocus

    Before focus is moved to an item (not selecting), ui.item refers to the focused item. The default action of focus is to replace the text field's value with the value of the focused item, though only if the focus event was triggered by a keyboard interaction. Canceling this event prevents the value from being updated, but does not prevent the menu item from being focused.

此事件在焦点移动到一个选项但未选中之前触发,参数ui.item表示当前处于焦点的选项。假如focus事件是由键盘交互触发的,focus事件的默认行为是把当前文本框的值设置成当前焦点所在的选项的文本。取消此事件能防止文本框的值被所选的替换掉,但是不能防止焦点选中菜单中的选项。
  • select

    Type:
    autocompleteselect

    Triggered when an item is selected from the menu; ui.item refers to the selected item. The default action of select is to replace the text field's value with the value of the selected item. Canceling this event prevents the value from being updated, but does not prevent the menu from closing.

此事件在选中提示菜单中的选项时被触发。参数ui.item表示当前选中的选项。 focus事件的默认行为是把当前文本框的值设置成选中的文本。 取消此事件能防止文本框的值被所选的替换掉,但是不能防止提示菜单关闭。
  • close

    Type:
    autocompleteclose

    When the list is hidden - doesn't have to occur together with a change.

当提示菜单关闭的时候触发。不必对此事件进行编程或者改变。
  • change

    Type:
    autocompletechange

    Triggered when the field is blurred, if the value has changed; ui.item refers to the selected item.

此事件在文本框焦点移出时触发。如果文本框的值发生改变,ui.item代表选中的选项。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值