You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article explains about the properties and methods of the **RadAutoCompleteBox** client-side object. The **RadAutoCompleteBox** client API allows for complete control over the client object, giving the developer the opportunity to set the behavior of the control depending on the scenario.
18
+
19
+
20
+
| Name | Parameters | Return Type | Description |
21
+
| ------ | ------ | ------ | ------ |
22
+
|get_text()|none|string|Returns a string containing the text of each entry, separated by a delimeter.|
23
+
|get_entries()|none|Telerik.Web.UI.AutoCompleteBoxEntryCollection|Returns a collection of all the entries. See Example 1.|
24
+
|get_inputElement()|none|DOM Object|Gets a reference to the HTML element representing the input area.|
25
+
|get_isUsingODataSource()|none|boolean|Returns *true* if RadAutoCompleteBox is bound to OData, *false* otherwise.|
26
+
|get_bindingMode()|none|Telerik.Web.UI.RadAutoCompleteBoxBinding Enum|Returns a number from the RadAutoCompleteBoxBinding enumeration. See Example 2.|
27
+
|set_requestDelay()|number (milliseconds)|undefined|Sets delay time in milliseconds, when a request to the datasource is being triggered. See Example 3.|
28
+
|clear()|none|none|Closes the drop-down container, deleting all the items present in it.|
29
+
|createEntry()|string,string|Telerik.Web.UI.AutoCompleteBoxEntry|Returns the created entry. See Example 1.|
30
+
|query()|string|none|Sends request to the server against the value passed as an argument. If no argument is passed, the request is made against the text currently present into the input area.|
31
+
32
+
**Example 1:** Access the **RadAutoCompleteBox** entries collection, and add new entry:
33
+
````JavaScript
34
+
35
+
functionaddEntry() {
36
+
var autoComplete =$find("<%= RadAutoCompleteBox1.ClientID %>");
37
+
var newEntry =autoComplete.createEntry('Text', 'Value');
This article explains about the properties and methods of the **AutoCompleteBoxEntry** client-side object.
18
+
19
+
| Name | Parameters | Return Type | Description |
20
+
| ------ | ------ | ------ | ------ |
21
+
|get_index()|none|number|Returns the index of the specified entry.|
22
+
|get_text()|none|string|Returns the text of the specified entry.|
23
+
|get_value()|none|string|Returns the value of the specified entry.|
24
+
|get_token()|none|DOM object|Returns a reference to the HTML element representing the specified entry. If the input type of RadAutoCompleteBox is set to "*Text*", the property will return nothing. See Example 1.|
25
+
|get_parent()|none|Telerik.Web.UI.RadAutoCompleteBox|Returns the parent object of the specified entry.|
26
+
27
+
**Example 1:** Create new entry, add it to the **RadAutoCompleteBox** entries collection and set the color of the new entry token DOM element to 'red':
28
+
````JavaScript
29
+
30
+
functionchangeTokenElementColor() {
31
+
var autoComplete =$find("<%= RadAutoCompleteBox1.ClientID %>");
32
+
var newEntry =autoComplete.createEntry('Text', 'Value');
The **AutoCompleteBoxEntryCollection** object is returned by the **get_items** method of the **RadAutoCompleteBox** object. The following table lists the most important methods:
18
+
19
+
20
+
| Name | Parameters | Return Type | Description |
21
+
| ------ | ------ | ------ | ------ |
22
+
|get_count()|none|Number|Returns the number of the entries present in the Entry collection.|
23
+
|add()|Telerik.Web.UI.AutoCompleteBoxEntry|none|Adds the specified entry into the Entry collection. See Example 4.|
24
+
|insert()|number,Telerik.Web.UI.AutoCompleteBoxEntry|none|Inserts an entry in the Entry collection with the specified index.|
25
+
|remove()|Telerik.Web.UI.AutoCompleteBoxEntry|none|Removes the specified entry from the Entry collection.|
26
+
|clear()|none|none|Clears all the entries from the Entry collection.|
27
+
|getEntry()|number|Telerik.Web.UI.AutoCompleteBoxEntry|Returns the entry with the specified index.|
28
+
|indexOf()|Telerik.Web.UI.AutoCompleteBoxEntry|number|Returns the index of the specified entry.|
Copy file name to clipboardExpand all lines: controls/autocompletebox/client-side-programming/overview.md
-103Lines changed: 0 additions & 103 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,106 +40,3 @@ Several client-side events occur immediately before **RadAutoCompleteBox** perfo
40
40
````
41
41
42
42
43
-
## RadAutoCompleteBox Client-Side Object Model
44
-
45
-
46
-
>caption Properties
47
-
48
-
| Name | Parameters | Return Type | Description |
49
-
| ------ | ------ | ------ | ------ |
50
-
|get_text()|none|string|Returns a string containing the text of each entry, separated by a delimeter.|
51
-
|get_entries()|none|Telerik.Web.UI.AutoCompleteBoxEntryCollection|Returns a collection of all the entries. See Example 1.|
52
-
|get_inputElement()|none|DOM Object|Gets a reference to the HTML element representing the input area.|
53
-
|get_isUsingODataSource()|none|boolean|Returns *true* if RadAutoCompleteBox is bound to OData, *false* otherwise.|
54
-
|get_bindingMode()|none|Telerik.Web.UI.RadAutoCompleteBoxBinding Enum|Returns a number from the RadAutoCompleteBoxBinding enumeration. See Example 2.|
55
-
|set_requestDelay()|number (milliseconds)|undefined|Sets delay time in milliseconds, when a request to the datasource is being triggered. See Example 3.|
56
-
57
-
**Example 1:** Access the **RadAutoCompleteBox** entries collection, and add new entry:
58
-
````JavaScript
59
-
60
-
functionaddEntry() {
61
-
var autoComplete =$find("<%= RadAutoCompleteBox1.ClientID %>");
62
-
var newEntry =autoComplete.createEntry('Text', 'Value');
**Example 3:** Set delay of 5 seconds when requesting data form the datasource:
81
-
````JavaScript
82
-
83
-
functiondelayRequest() {
84
-
var autoComplete =$find("<%= RadAutoCompleteBox1.ClientID %>");
85
-
autoComplete.set_requestDelay(5000);
86
-
}
87
-
88
-
````
89
-
90
-
>caption Methods
91
-
92
-
| Name | Parameters | Return Type | Description |
93
-
| ------ | ------ | ------ | ------ |
94
-
|clear()|none|none|Closes the drop-down container, deleting all the items present in it.|
95
-
|createEntry()|string,string|Telerik.Web.UI.AutoCompleteBoxEntry|Returns the created entry. See Example 1.|
96
-
|query()|string|none|Sends request to the server against the value passed as an argument. If no argument is passed, the request is made against the text currently present into the input area.|
97
-
98
-
## AutoCompleteBoxEntry Client-Side Object Model
99
-
100
-
101
-
>caption Properties
102
-
103
-
| Name | Parameters | Return Type | Description |
104
-
| ------ | ------ | ------ | ------ |
105
-
|get_index()|none|number|Returns the index of the specified entry.|
106
-
|get_text()|none|string|Returns the text of the specified entry.|
107
-
|get_value()|none|string|Returns the value of the specified entry.|
108
-
|get_token()|none|DOM object|Returns a reference to the HTML element representing the specified entry. If the input type of RadAutoCompleteBox is set to "*Text*", the property will return nothing. See Example 4.|
109
-
|get_parent()|none|Telerik.Web.UI.RadAutoCompleteBox|Returns the parent object of the specified entry.|
110
-
111
-
**Example 4:** Create new entry, add it to the **RadAutoCompleteBox** entries collection and set the color of the new entry token DOM element to 'red':
112
-
````JavaScript
113
-
114
-
functionchangeTokenElementColor() {
115
-
var autoComplete =$find("<%= RadAutoCompleteBox1.ClientID %>");
116
-
var newEntry =autoComplete.createEntry('Text', 'Value');
117
-
var entries =autoComplete.get_entries();
118
-
entries.add(newEntry);
119
-
var tokenDomElement =newEntry.get_token();
120
-
tokenDomElement.style.color="red";
121
-
}
122
-
123
-
````
124
-
125
-
126
-
## AutoCompleteBoxEntryCollection Client-Side Object Model
127
-
128
-
129
-
>caption Properties
130
-
131
-
| Name | Parameters | Return Type | Description |
132
-
| ------ | ------ | ------ | ------ |
133
-
|get_count()|none|Number|Returns the number of the entries present in the Entry collection.|
134
-
135
-
136
-
>caption Methods
137
-
138
-
| Name | Parameters | Return Type | Description |
139
-
| ------ | ------ | ------ | ------ |
140
-
|add()|Telerik.Web.UI.AutoCompleteBoxEntry|none|Adds the specified entry into the Entry collection. See Example 4.|
141
-
|insert()|number,Telerik.Web.UI.AutoCompleteBoxEntry|none|Inserts an entry in the Entry collection with the specified index.|
142
-
|remove()|Telerik.Web.UI.AutoCompleteBoxEntry|none|Removes the specified entry from the Entry collection.|
143
-
|clear()|none|none|Clears all the entries from the Entry collection.|
144
-
|getEntry()|number|Telerik.Web.UI.AutoCompleteBoxEntry|Returns the entry with the specified index.|
145
-
|indexOf()|Telerik.Web.UI.AutoCompleteBoxEntry|number|Returns the index of the specified entry.|
0 commit comments