Hi There,
I'm busy implementing filtering of RadComboBox items from the client-side by calling the .hide() method of the combobox-item.
This results in the items I specify to be hidden from view for the user.
The problem I find is that once I click the Combo that was filtered and I click anywhere else on the html page, the items that I had set to be hidden become visible again.
Right now I think:
Additional Information:
Telerik Controls Version: 2010.1.415.40
Your help would be greatly appreciated.
Best,
Llewellyn
I'm busy implementing filtering of RadComboBox items from the client-side by calling the .hide() method of the combobox-item.
This results in the items I specify to be hidden from view for the user.
The problem I find is that once I click the Combo that was filtered and I click anywhere else on the html page, the items that I had set to be hidden become visible again.
Right now I think:
- RadCombo is executing an event once the RadCombo is focused on (selected) and then looses focus. This event makes all the items visible again.
- or I am not using the .hide() method correctly and require instructions for proper use,
<
telerik:RadComboBox
ID
=
"rcboProject"
runat
=
"server"
AppendDataBoundItems
=
"True"
DataTextField
=
"Name"
DataValueField
=
"ClientNameProjectID"
DataSourceID
=
"objProject"
MarkFirstMatch
=
"true"
AllowCustomText
=
"true"
Filter
=
"Contains"
NoWrap
=
"true"
>
<
Items
>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"Non Project"
Value
=
"-1"
/>
</
Items
>
</
telerik:RadComboBox
>
// this function is called from client side event such as a button click or perhaps even by the
// OnClientSelectedIndexChanged event of another combo box(obviously it would need event params in that case).
function
FilterProjects() {
// GetProjectCombo(index)
var
projectCombo = GetProjectCombo();
// Get project combo items.
var
projectItems = projectCombo.get_items();
projectCombo.trackChanges();
// loop through, hide * projects except the top 10
for
(i = 0; i < projectItems._array.length; i++)
{
if
(i < 10)
continue
;
// Get Item, load its data.
var
item = projectItems.getItem(i);
var
itemValue = item.get_value();
if
(
true
)
// simplified for Telerik support.
{
item.hide();
// works temporarily until clicking on html body then it reverts back to original state.
//item.removeAt(i); // works and persists.
//item.disable(); // works and persists.
}
}
projectCombo.commitChanges();
}
function
GetProjectCombo(index) {
return
$find(
"<%= rcboProject.ClientID %>"
);
}
Additional Information:
Telerik Controls Version: 2010.1.415.40
Your help would be greatly appreciated.
Best,
Llewellyn