API Docs for: 3.17.2
Show:

File: autocomplete/js/autocomplete-plugin.js

  1. /**
  2. Binds an AutoCompleteList instance to a Node instance.
  3.  
  4. @module autocomplete
  5. @submodule autocomplete-plugin
  6. **/
  7.  
  8. /**
  9. Binds an AutoCompleteList instance to a Node instance.
  10.  
  11. @example
  12.  
  13. Y.one('#my-input').plug(Y.Plugin.AutoComplete, {
  14. source: 'select * from search.suggest where query="{query}"'
  15. });
  16.  
  17. // You can now access the AutoCompleteList instance at Y.one('#my-input').ac
  18.  
  19. @class Plugin.AutoComplete
  20. @extends AutoCompleteList
  21. **/
  22.  
  23. var Plugin = Y.Plugin;
  24.  
  25. function ACListPlugin(config) {
  26. config.inputNode = config.host;
  27.  
  28. // Render by default.
  29. if (!config.render && config.render !== false) {
  30. config.render = true;
  31. }
  32.  
  33. ACListPlugin.superclass.constructor.apply(this, arguments);
  34. }
  35.  
  36. Y.extend(ACListPlugin, Y.AutoCompleteList, {}, {
  37. NAME : 'autocompleteListPlugin',
  38. NS : 'ac',
  39. CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')
  40. });
  41.  
  42. Plugin.AutoComplete = ACListPlugin;
  43. Plugin.AutoCompleteList = ACListPlugin;
  44.