This example demonstrates how to apply the jQuery AutoComplete
plugin to a text box editor.
To apply jQuery selectors to a text box editor, use one of the following approaches:
-
Add a ASPxGlobalEvents component to the page and handle its client-side ControlsInitialized event to initialize the text box editor. To access the editor, use its ClientInstanceName property.
function OnControlsInitialized(s, e) { $(txt.GetInputElement()).autocomplete({ source: availableTags, position: { my: "left top", at: "left bottom", of: txt.GetMainElement() }, select: function (event, ui) { txt.SetValue(ui.item.value); } }); }
-
Handle the editor's client-side
Init
event and use thes
parameter to get the corresponding the client object.function OnTextBoxInit(s, e) { $(s.GetInputElement()).autocomplete({ source: availableTags, position: { my: "left top", at: "left bottom", of: s.GetMainElement() }, select: function (event, ui) { s.SetValue(ui.item.value); } }); }
- ControlEvents.aspx (VB: ControlEvents.aspx)
- GlobalEvents.aspx (VB: GlobalEvents.aspx)
- AutoCompleteStyles.css
(you will be redirected to DevExpress.com to submit your response)