Skip to content

Commit 507ef31

Browse files
committed
Fix tables and examples in ComboBox client-side objects articles
1 parent 4e73b6b commit 507ef31

File tree

3 files changed

+114
-126
lines changed

3 files changed

+114
-126
lines changed

controls/combobox/client-side-programming/objects/radcombobox-object.md

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,61 @@ The following table lists the most important methods of the client-side **RadCom
2727
2828
| Name | Parameters | Return Type | Description |
2929
| ------ | ------ | ------ | ------ |
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.|
3279

80+
81+
82+
83+
84+
>caption Example 1: Add a new item and persist it after a postback.
3385
````JavaScript
3486

3587
function AddNewItem() {
@@ -46,14 +98,7 @@ function AddNewItem() {
4698

4799

48100

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.
57102
````JavaScript
58103

59104
function SetTextOfTheComboBox() {
@@ -63,26 +108,9 @@ function SetTextOfTheComboBox() {
63108

64109
````
65110

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.|
85111

112+
113+
>caption Example 3: Clear the selection.
86114
````JavaScript
87115

88116
function ClearSelection() {
@@ -92,10 +120,9 @@ function ClearSelection() {
92120

93121
````
94122

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** ).|
98123

124+
125+
>caption Example 4: Initiate a load-on-demand callback request with the specified text.
99126
````ASPNET
100127
101128
<script language="javascript" type="text/javascript">
@@ -105,22 +132,18 @@ function AddItems() {
105132
}
106133
</script>
107134
108-
<telerik:radcombobox
135+
<telerik:RadComboBox
109136
id="RadComboBox1"
110137
runat="server"
111138
onitemsrequested="RadComboBox1_ItemsRequested">
112-
</telerik:radcombobox>
139+
</telerik:RadComboBox>
113140
<input id="Button1" type="button" value="button" onclick="AddItems()" />
114141
115142
````
116143

117-
| Name | Parameters | Return Type | Description |
118-
| ------ | ------ | ------ | ------ |
119-
| **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.|
122144

123145

146+
>caption Example 5: Set the background-color of the input area.
124147
````JavaScript
125148

126149
function ChangeInputColor() {
@@ -131,11 +154,9 @@ function ChangeInputColor() {
131154

132155
````
133156

134-
| Name | Parameters | Return Type | Description |
135-
| ------ | ------ | ------ | ------ |
136-
| **get_imageDomElement** |none|DOM object|Gets a reference to image element (drop-down toggle).|
137157

138158

159+
>caption Example 6: Set the image DOM element's src attribute.
139160
````JavaScript
140161

141162
function ChangeImageElement() {
@@ -146,28 +167,7 @@ function ChangeImageElement() {
146167

147168
````
148169

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.|
170+
171171

172172
# See Also
173173

controls/combobox/client-side-programming/objects/radcomboboxitem-object.md

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,44 @@ position: 1
1616

1717
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:
1818

19+
>caption
1920
20-
| **Name** | **Parameters** | **Return Type** | **Description** |
21+
| Name | Parameters | Return Type | Description |
2122
| ------ | ------ | ------ | ------ |
2223
| **highlight** |none|none|Highlights an item.|
2324
| **unHighlight** |none|none|Unhighlights an item.|
2425
| **select** |none|none|Selects an item.|
2526
| **disable** |none|none|Disables an item.|
2627
| **enable** |none|none|Enables an item.|
27-
| **get_comboBox** |none|object|Gets the parent RadComboBox control.|
28+
| **get_comboBox** |none|object|Gets the parent **RadComboBox** control. See **Example 1**. |
29+
| **get_highlighted** |none|boolean| **True** if the item is highlighted. To highlight an item use the **highlight** method.|
30+
| **get_index** |none|int|Gets the index of an item in the Items collection.|
31+
| **get_enabled** |none|boolean| **True** if the item is enabled. To enable an item use the **enable** method.|
32+
| **get_text** |none|string|Gets the text of an item.|
33+
| **set_text** |string|none|Sets text of an item.|
34+
| **get_value** |none|string|Gets the value of an item.|
35+
| **set_value** |string|none|Sets the value of an item.|
36+
| **get_checked** |none|boolean|True if an item is checked, False if not.|
37+
| **set_checked** |boolean|none|Checks or unchecks an item.|
38+
| **get_isSeparator** |none|boolean|True if an item is separator (IsSeparator="True").|
39+
| **get_attributes** |none|collection|Returns a collection of custom attributes defined for an item.|
40+
| **getAttribute** |String|String|Returns a specific attribute from the Attributes collection.|
41+
| **setAttribute** |String, String|none|Adds an attribute to the Attributes collection. See **Example 2**. |
42+
| **get_visible** |none|boolean|True if the item is visible.|
43+
| **set_visible** |boolean|none|Sets the visibility of an item.|
44+
| **show** |none|none|Makes the item visible, same as set_visible(true).|
45+
| **hide** |none|none|Makes the item invisible, same as set_visible(false).|
46+
| **get_imageUrl** |none|string|Returns the full path to an item's image.|
47+
| **set_imageUrl** |string|none|Sets the **ImageUrl** property of an item.|
48+
| **get_disabledImageUrl** |none|string|Returns the full path to the image of a disabled item.|
49+
| **set_disabledImageUrl** |string|none|Sets the **DisabledImageUrl** property of an item.|
50+
| **findControl** |string|object|Returns the object which is in the item template.|
51+
| **get_element** |none|HTML element|Returns the `<LI>` HTML element of an item.|
52+
2853

2954

55+
56+
>caption Example 1: Gets the parent **RadComboBox** control.
3057
````ASPNET
3158
3259
<script language="javascript" type="text/javascript">
@@ -44,24 +71,8 @@ The **RadComboBoxItem** object is returned by the **getItem** method of the **Ra
4471
````
4572

4673

47-
| **Name** | **Parameters** | **Return Type** | **Description** |
48-
| ------ | ------ | ------ | ------ |
49-
| **get_highlighted** |none|boolean| **True** if the item is highlighted. To highlight an item use the **highlight** method.|
50-
| **get_index** |none|int|Gets the index of an item in the Items collection.|
51-
| **get_enabled** |none|boolean| **True** if the item is enabled. To enable an item use the **enable** method.|
52-
| **get_text** |none|string|Gets the text of an item.|
53-
| **set_text** |string|none|Sets text of an item.|
54-
| **get_value** |none|string|Gets the value of an item.|
55-
| **set_value** |string|none|Sets the value of an item.|
56-
| **get_checked** |none|boolean|True if an item is checked, False if not.|
57-
| **set_checked** |boolean|none|Checks or unchecks an item.|
58-
| **get_isSeparator** |none|boolean|True if an item is separator (IsSeparator="True").|
59-
| **get_attributes** |none|collection|Returns a collection of custom attributes defined for an item.|
60-
| **getAttribute** |String|String|Returns a specific attribute from the Attributes collection.|
61-
| **setAttribute** |String, String|none|Adds an attribute to the Attributes collection.|
62-
63-
6474

75+
>caption Example 2: Get an item's attribute and set a value to it.
6576
````JavaScript
6677

6778
var combo = $find("<%= RadComboBox2.ClientID %>");
@@ -76,20 +87,6 @@ item.get_attributes().setAttribute("Size", "2");
7687
````
7788

7889

79-
| **Name** | **Parameters** | **Return Type** | **Description** |
80-
| ------ | ------ | ------ | ------ |
81-
| **get_visible** |none|boolean|True if the item is visible.|
82-
| **set_visible** |boolean|none|Sets the visibility of an item.|
83-
| **show** |none|none|Makes the item visible, same as set_visible(true).|
84-
| **hide** |none|none|Makes the item invisible, same as set_visible(false).|
85-
| **get_imageUrl** |none|string|Returns the full path to an item's image.|
86-
| **set_imageUrl** |string|none|Sets the **ImageUrl** property of an item.|
87-
| **get_disabledImageUrl** |none|string|Returns the full path to the image of a disabled item.|
88-
| **set_disabledImageUrl** |string|none|Sets the **DisabledImageUrl** property of an item.|
89-
| **findControl** |string|object|Returns the object which is in the item template.|
90-
| **get_element** |none|HTML element|Returns the `<LI>` HTML element of an item.|
91-
92-
9390

9491
# See Also
9592

0 commit comments

Comments
 (0)