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
Copy file name to clipboardExpand all lines: controls/combobox/client-side-programming/objects/radcombobox-object.md
+64-64Lines changed: 64 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,61 @@ The following table lists the most important methods of the client-side **RadCom
27
27
28
28
| Name | Parameters | Return Type | Description |
29
29
| ------ | ------ | ------ | ------ |
30
-
|**trackChanges**|none|none|Starts tracking changes made to **RadComboBox** that will be preserved over postbacks.|
31
-
|**commitChanges**|none|none|Writes the changes to **RadComboBox** that were made since a previous call to **trackChanges** , so that they are preserved over postbacks.|
30
+
|**trackChanges**|none|none|Starts tracking changes made to **RadComboBox** that will be preserved over postbacks. See **Example 1**. |
31
+
|**commitChanges**|none|none|Writes the changes to **RadComboBox** that were made since a previous call to **trackChanges** , so that they are preserved over postbacks. Client-side changes are available on the server after postback. You can use the [ClientChanges]({%slug combobox/client-side-programming/accessing-client-changes-at-the-server%}) property to access them. See **Example 1**. |
32
+
|**set_text**|(string text)|none|Sets the text of the input field to the value of the specified parameter. See **Example 2**. |
33
+
|**get_text**|none|string|Gets the text of the input field.|
34
+
|**get_checkedItems**|none|array|Gets an array of the checked **RadComboBoxItem** objects.|
35
+
|**get_lastWord**|none|string|Gets the word after the last separator in the text of **RadComboBox** input field. If a separator is not set, returns the text itself.|
36
+
|**set_allowCustomEntry**|Boolean|none| Allows/Disallows the users to type text in the input area, when called with 'false' as a parameter - the input area contains only the currently selected item's text, or text obtained by all selected items' texts separated by comma or other character.|
37
+
|**get_allowCustomEntry**|none|Boolean| Returns **true** the users are allowed to type random text in the input area, **false** otherwise.|
38
+
|**set_emptyMessage**|(string text)|none|Sets the **EmptyMessage** text of **RadComboBox** input field.|
39
+
|**get_emptyMessage**|none|string|Gets the **EmptyMessage** text of **RadComboBox** input field.|
40
+
|**set_value**|(string value)|none|Sets the value of **RadComboBox** .|
41
+
|**get_value**|none|string|Gets the value of **RadComboBox** .|
42
+
|**showDropDown**|none|none|Opens the drop-down list.|
43
+
|**set_closeDropDownOnBlur**|Boolean|none|If you call the **showDropDown** / **toggleDropDown** method on a button click, you will have to use **combo.set_closeDropDownOnBlur(false)** right before you call the **showDropDown** / **toggleDropDown** method, otherwise the drop-down area will flicker instead of open. Then, you should use **combo.set_closeDropDownOnBlur(true)** in the **OnClientBlur** event handler. You can see a demo at: [Add/Remove/Disable Items](http://demos.telerik.com/aspnet-ajax/combobox/examples/programming/addremovedisableitemsclientside/defaultcs.aspx)|
44
+
|**hideDropDown**|none|none|Closes the drop-down list.|
45
+
|**toggleDropDown**|none|none|Toggles the drop-down list.|
46
+
|**enable**|none|none|Enables the **RadComboBox** .|
47
+
|**disable**|none|none|Disables the **RadComboBox** .|
48
+
|**findItemByValue**|(string value)|**RadComboBoxItem**|Returns the first **RadComboBoxItem** object whose **Value** property equals the passed parameter.|
49
+
|**findItemByText**|(string text)|**RadComboBoxItem**|Returns the first **RadComboBoxItem** object whose **Text** property equals the passed parameter.|
50
+
|**findFirstMatch**|string|**RadComboBoxItem**|Returns the first **RadComboBoxItem** object whose **Text** contains the string passed as parameter.|
51
+
|**clearItems**|none|none|Clears all items of **RadComboBox** .|
52
+
|**clearSelection**|none|none|Clears the selection. See **Example 3**. |
53
+
|**requestItems**|(string text, Boolean)|none|Initiates a [load-on-demand]({%slug combobox/load-on-demand/overview%})callback request with the specified text, causing the **ItemsRequested** server event to fire or a request to be sent to a web service. The second Boolean parameter instructs the **RadComboBox** to append the new items ( **True** ) or clear items ( **False** ). See **Example 4**. |
54
+
|**get_id**|none|string|Gets the server-side ID of the **RadComboBox** instance.|
55
+
|**get_dropDownElement**|none|DOM object|Gets a reference to the drop-down list.|
56
+
|**get_inputDomElement**|none|DOM object|Gets a reference to the input area. See **Example 5**. |
57
+
|**get_imageDomElement**|none|DOM object|Gets a reference to image element (drop-down toggle). See **Example 6**. |
58
+
|**get_moreResultsBoxElement**|none|DOM object|Gets a reference to the **MoreResultsBox** image element.|
59
+
|**get_moreResultsBoxMessageElement**|none|DOM object|Gets a reference to the **MoreResultsBox Message** element.|
60
+
|**get_dropDownVisible**|none|Boolean|**True** if the drop-down is opened.|
61
+
|**set_enabled**|Boolean|none| Enables/disables the **RadComboBox**.|
62
+
|**get_enabled**|none|Boolean|**True** if **RadComboBox** is enabled.|
63
+
|**get_selectedItem**|none|**RadComboBoxItem**|Gets the currently selected item.|
64
+
|**get_selectedIndex**|none|integer|Gets the index of the currently selected item.|
65
+
|**get_items**|none|**RadComboBoxItemCollection**|Returns the items collection for **RadComboBox** .|
66
+
|**get_enableItemCaching**|none|boolean|**True** if item caching is enabled (applicable in load-on-demand scenario).|
67
+
|**set_enableItemCaching**|boolean|none|Enables/disables item caching (applicable in load-on-demand scenario).|
68
+
|**attachDropDown**|none|none|Attach the drop down list to the input element if it is not aligned properly, especially when a postback fires from a templated item. Use it in this scenario: [ Ajaxified control in ItemTemplate does a full postback. ]({%slug combobox/troubleshooting/ajaxified-control-in-itemtemplate-does-a-full-postback%})|
69
+
|**get_visibleItems**|none|array|Returns all visible items.|
70
+
|**setAllItemsVisible**|Boolean|none|Sets all items visible / invisible.|
71
+
|**get_changeText**|none|Boolean|**True** if **ChangeTextOnKeyBoardNavigation** is **true** .|
72
+
|**set_changeText**|Boolean|none|Sets the **ChangeTextOnKeyBoardNavigation** property.|
73
+
|**get_enableTextSelection**|none|Boolean|**True** if **EnableTextSelection** is **True** .|
74
+
|**set_enableTextSelection**|boolean|none|Sets the **EnableTextSelection** property.|
75
+
|**get_markFirstMatch**|none|Boolean|**True** if **MarkFirstMatch** is **true** .|
76
+
|**set_markFirstMatch**|Boolean|none|Sets the **MarkFirstMatch** property.|
77
+
|**clearCache**|none|none|Clears the items cache if [EnableItemCaching]({%slug combobox/load-on-demand/caching-items%}) is **True** .|
78
+
|**get_highlightedItem**|none|**RadComboBoxItem**|Gets the currently highlighted item.|
32
79
80
+
81
+
82
+
83
+
84
+
>caption Example 1: Add a new item and persist it after a postback.
33
85
````JavaScript
34
86
35
87
functionAddNewItem() {
@@ -46,14 +98,7 @@ function AddNewItem() {
46
98
47
99
48
100
49
-
>tip Client-side changes are available on the server after postback. You can use the [ClientChanges]({%slug combobox/client-side-programming/accessing-client-changes-at-the-server%}) property to access them.
50
-
>
51
-
52
-
| Name | Parameters | Return Type | Description |
53
-
| ------ | ------ | ------ | ------ |
54
-
|**set_text**|(string text)|none|Sets the text of the input field to the value of the specified parameter.|
55
-
56
-
101
+
>caption Example 2: Set **RadComboBox**'s text.
57
102
````JavaScript
58
103
59
104
functionSetTextOfTheComboBox() {
@@ -63,26 +108,9 @@ function SetTextOfTheComboBox() {
63
108
64
109
````
65
110
66
-
| Name | Parameters | Return Type | Description |
67
-
| ------ | ------ | ------ | ------ |
68
-
|**get_text**|none|string|Gets the text of the input field.|
69
-
|**get_checkedItems**|none|array|Gets an array of the checked **RadComboBoxItem** objects.|
70
-
|**get_lastWord**|none|string|Gets the word after the last separator in the text of **RadComboBox** input field. If a separator is not set, returns the text itself.|
71
-
|**set_emptyMessage**|(string text)|none|Sets the **EmptyMessage** text of **RadComboBox** input field.|
72
-
|**get_emptyMessage**|none|string|Gets the **EmptyMessage** text of **RadComboBox** input field.|
73
-
|**set_value**|(string value)|none|Sets the value of **RadComboBox** .|
74
-
|**get_value**|none|string|Gets the value of **RadComboBox** .|
75
-
|**showDropDown**|none|none|Opens the drop-down list.|
76
-
|**set_closeDropDownOnBlur**|Boolean|none|If you call the **showDropDown** / **toggleDropDown** method on a button click, you will have to use **combo.set_closeDropDownOnBlur(false)** right before you call the **showDropDown** / **toggleDropDown** method, otherwise the drop-down area will flicker instead of open. Then, you should use **combo.set_closeDropDownOnBlur(true)** in the **OnClientBlur** event handler. You can see a demo at: [Add/Remove/Disable Items](http://demos.telerik.com/aspnet-ajax/combobox/examples/programming/addremovedisableitemsclientside/defaultcs.aspx)|
77
-
|**hideDropDown**|none|none|Closes the drop-down list.|
78
-
|**toggleDropDown**|none|none|Toggles the drop-down list.|
79
-
|**enable**|none|none|Enables the **RadComboBox** .|
80
-
|**disable**|none|none|Disables the **RadComboBox** .|
81
-
|**findItemByValue**|(string value)|**RadComboBoxItem**|Returns the first **RadComboBoxItem** object whose **Value** property equals the passed parameter.|
82
-
|**findItemByText**|(string text)|**RadComboBoxItem**|Returns the first **RadComboBoxItem** object whose **Text** property equals the passed parameter.|
83
-
|**clearItems**|none|none|Clears all items of **RadComboBox** .|
84
-
|**clearSelection**|none|none|Clears the selection.|
85
111
112
+
113
+
>caption Example 3: Clear the selection.
86
114
````JavaScript
87
115
88
116
functionClearSelection() {
@@ -92,10 +120,9 @@ function ClearSelection() {
92
120
93
121
````
94
122
95
-
| Name | Parameters | Return Type | Description |
96
-
| ------ | ------ | ------ | ------ |
97
-
|**requestItems**|(string text, Boolean)|none|Initiates a [load-on-demand]({%slug combobox/load-on-demand/overview%})callback request with the specified text, causing the **ItemsRequested** server event to fire or a request to be sent to a web service. The second Boolean parameter instructs the **RadComboBox** to append the new items ( **True** ) or clear items ( **False** ).|
98
123
124
+
125
+
>caption Example 4: Initiate a load-on-demand callback request with the specified text.
|**get_id**|none|string|Gets the server-side ID of the **RadComboBox** instance.|
120
-
|**get_dropDownElement**|none|DOM object|Gets a reference to the drop-down list.|
121
-
|**get_inputDomElement**|none|DOM object|Gets a reference to the input area.|
122
144
123
145
146
+
>caption Example 5: Set the background-color of the input area.
124
147
````JavaScript
125
148
126
149
functionChangeInputColor() {
@@ -131,11 +154,9 @@ function ChangeInputColor() {
131
154
132
155
````
133
156
134
-
| Name | Parameters | Return Type | Description |
135
-
| ------ | ------ | ------ | ------ |
136
-
|**get_imageDomElement**|none|DOM object|Gets a reference to image element (drop-down toggle).|
137
157
138
158
159
+
>caption Example 6: Set the image DOM element's src attribute.
139
160
````JavaScript
140
161
141
162
functionChangeImageElement() {
@@ -146,28 +167,7 @@ function ChangeImageElement() {
146
167
147
168
````
148
169
149
-
| Name | Parameters | Return Type | Description |
150
-
| ------ | ------ | ------ | ------ |
151
-
|**get_moreResultsBoxElement**|none|DOM object|Gets a reference to the **MoreResultsBox** image element.|
152
-
|**get_moreResultsBoxMessageElement**|none|DOM object|Gets a reference to the **MoreResultsBox Message** element.|
153
-
|**get_dropDownVisible**|none|Boolean|**True** if the drop-down is opened.|
154
-
|**get_enabled**|none|Boolean|**True** if **RadComboBox** is enabled.|
155
-
|**get_selectedItem**|none|**RadComboBoxItem**|Gets the currently selected item.|
156
-
|**get_selectedIndex**|none|integer|Gets the index of the currently selected item.|
157
-
|**get_items**|none|**RadComboBoxItemCollection**|Returns the items collection for **RadComboBox** .|
158
-
|**get_enableItemCaching**|none|boolean|**True** if item caching is enabled (applicable in load-on-demand scenario).|
159
-
|**set_enableItemCaching**|boolean|none|Enables/disables item caching (applicable in load-on-demand scenario).|
160
-
|**attachDropDown**|none|none|Attach the drop down list to the input element if it is not aligned properly, especially when a postback fires from a templated item. Use it in this scenario: [ Ajaxified control in ItemTemplate does a full postback. ]({%slug combobox/troubleshooting/ajaxified-control-in-itemtemplate-does-a-full-postback%})|
161
-
|**get_visibleItems**|none|array|Returns all visible items.|
162
-
|**setAllItemsVisible**|Boolean|none|Sets all items visible / invisible.|
163
-
|**get_changeText**|none|Boolean|**True** if **ChangeTextOnKeyBoardNavigation** is **true** .|
164
-
|**set_changeText**|Boolean|none|Sets the **ChangeTextOnKeyBoardNavigation** property.|
165
-
|**get_enableTextSelection**|none|Boolean|**True** if **EnableTextSelection** is **True** .|
166
-
|**set_enableTextSelection**|boolean|none|Sets the **EnableTextSelection** property.|
167
-
|**get_markFirstMatch**|none|Boolean|**True** if **MarkFirstMatch** is **true** .|
168
-
|**set_markFirstMatch**|Boolean|none|Sets the **MarkFirstMatch** property.|
169
-
|**clearCache**|none|none|Clears the items cache if [EnableItemCaching]({%slug combobox/load-on-demand/caching-items%}) is **True** .|
170
-
|**get_highlightedItem**|none|**RadComboBoxItem**|Gets the currently highlighted item.|
Copy file name to clipboardExpand all lines: controls/combobox/client-side-programming/objects/radcomboboxitem-object.md
+30-33Lines changed: 30 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,17 +16,44 @@ position: 1
16
16
17
17
The **RadComboBoxItem** object is returned by the **getItem** method of the **RadComboBoxItemCollection** object. It is also exposed by the eventArgs of many client-side events (**eventArgs.get_item()**). The following table lists the most important methods:
0 commit comments