Skip to content

Commit 1278611

Browse files
committed
Extracted AutoCompleteBox client-side objects into separate articles
1 parent 96b0f74 commit 1278611

File tree

5 files changed

+167
-103
lines changed

5 files changed

+167
-103
lines changed

_config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ navigation:
497497
"*ajaxmanager/performance":
498498
title: "Performance"
499499
position: 8
500+
"*autocompletebox/client-side-programming/objects":
501+
title: "Objects"
502+
position: 4
500503
"*autocompletebox/templates":
501504
title: "Templates"
502505
position: 4
@@ -1151,6 +1154,9 @@ navigation:
11511154
"*navigation/data-binding":
11521155
title: "Data Binding"
11531156
position: 6
1157+
"*navigation/client-side-programming/objects":
1158+
title: "Objects"
1159+
position: 1
11541160
"*notification/setting-content":
11551161
title: "Setting Content"
11561162
position: 4
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: RadAutoCompleteBox Object
3+
page_title: RadAutoCompleteBox Object | AutoCompleteBox for ASP.NET AJAX Documentation
4+
description: RadAutoCompleteBox Object
5+
slug: autocompletebox/client-side-programming/objects/radautocompletebox-object
6+
tags: autocompletebox,object
7+
published: True
8+
position: 0
9+
---
10+
11+
# RadAutoCompleteBox Object
12+
13+
14+
15+
##
16+
17+
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+
function addEntry() {
36+
var autoComplete = $find("<%= RadAutoCompleteBox1.ClientID %>");
37+
var newEntry = autoComplete.createEntry('Text', 'Value');
38+
var entries = autoComplete.get_entries();
39+
entries.add(newEntry);
40+
}
41+
42+
````
43+
44+
45+
**Example 2:** Telerik.Web.UI.RadAutoCompleteBoxBinding Enumeration:
46+
````ASPNET
47+
RadAutoCompleteBoxBinding:
48+
{
49+
Callback: 0,
50+
WebService: 1,
51+
OData: 2
52+
}
53+
````
54+
55+
**Example 3:** Set delay of 5 seconds when requesting data form the datasource:
56+
````JavaScript
57+
58+
function delayRequest() {
59+
var autoComplete = $find("<%= RadAutoCompleteBox1.ClientID %>");
60+
autoComplete.set_requestDelay(5000);
61+
}
62+
63+
````
64+
65+
66+
# See Also
67+
68+
* [AutoCompleteBoxEntry Object]({%slug autocompletebox/client-side-programming/objects/autocompleteboxentry-object%})
69+
70+
* [AutoCompleteBoxEntryCollection Object]({%slug autocompletebox/client-side-programming/objects/autocompleteboxentrycollection-object%})
71+
72+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: AutoCompleteBoxEntry Object
3+
page_title: AutoCompleteBoxEntry Object | AutoCompleteBox for ASP.NET AJAX Documentation
4+
description: AutoCompleteBoxEntry Object
5+
slug: autocompletebox/client-side-programming/objects/autocompleteboxentry-object
6+
tags: autocompletebox,object
7+
published: True
8+
position: 1
9+
---
10+
11+
# AutoCompleteBoxEntry Client-Side Object Model
12+
13+
14+
15+
##
16+
17+
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+
function changeTokenElementColor() {
31+
var autoComplete = $find("<%= RadAutoCompleteBox1.ClientID %>");
32+
var newEntry = autoComplete.createEntry('Text', 'Value');
33+
var entries = autoComplete.get_entries();
34+
entries.add(newEntry);
35+
var tokenDomElement = newEntry.get_token();
36+
tokenDomElement.style.color = "red";
37+
}
38+
39+
````
40+
41+
42+
43+
44+
# See Also
45+
46+
* [RadAutoCompleteBox Object]({%slug autocompletebox/client-side-programming/objects/radautocompletebox-object%})
47+
48+
* [AutoCompleteBoxEntryCollection Object]({%slug autocompletebox/client-side-programming/objects/autocompleteboxentrycollection-object%})
49+
50+
51+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: AutoCompleteBoxEntryCollection Object
3+
page_title: AutoCompleteBoxEntryCollection Object | AutoCompleteBox for ASP.NET AJAX Documentation
4+
description: AutoCompleteBoxEntryCollection Object
5+
slug: autocompletebox/client-side-programming/objects/autocompleteboxentrycollection-object
6+
tags: autocompletebox,object
7+
published: True
8+
position: 2
9+
---
10+
11+
# AutoCompleteBoxEntryCollection Object
12+
13+
14+
15+
##
16+
17+
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.|
29+
30+
31+
32+
33+
# See Also
34+
35+
* [RadAutoCompleteBox Object]({%slug autocompletebox/client-side-programming/objects/radautocompletebox-object%})
36+
37+
* [AutoCompleteBoxEntry Object]({%slug autocompletebox/client-side-programming/objects/autocompleteboxentry-object%})
38+

controls/autocompletebox/client-side-programming/overview.md

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -40,106 +40,3 @@ Several client-side events occur immediately before **RadAutoCompleteBox** perfo
4040
````
4141

4242

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-
function addEntry() {
61-
var autoComplete = $find("<%= RadAutoCompleteBox1.ClientID %>");
62-
var newEntry = autoComplete.createEntry('Text', 'Value');
63-
var entries = autoComplete.get_entries();
64-
entries.add(newEntry);
65-
}
66-
67-
````
68-
69-
70-
**Example 2:** Telerik.Web.UI.RadAutoCompleteBoxBinding Enumeration:
71-
````ASPNET
72-
RadAutoCompleteBoxBinding:
73-
{
74-
Callback: 0,
75-
WebService: 1,
76-
OData: 2
77-
}
78-
````
79-
80-
**Example 3:** Set delay of 5 seconds when requesting data form the datasource:
81-
````JavaScript
82-
83-
function delayRequest() {
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-
function changeTokenElementColor() {
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

Comments
 (0)