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代表选中的选项。

你可能感兴趣的:(编程,autocomplete,action,menu,keyboard,delay)