hi, i have rad combobox in my web page that i defined it like this:
<telerik:RadComboBox DropDownWidth="220px" runat="server" ID="UnitCombo">
<HeaderTemplate>
<table cellpadding="0" width="200px" cellspacing="0">
<tr>
<td style=" width:100px" >unit</td>
<td style="width:100px">ReviseState</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table cellpadding="0" width="200px" cellspacing="0">
<tr>
<td style=" width:100px" >
<%# DataBinder.Eval(Container,"Text") %>
</td>
<td style="width:100px">
<%# DataBinder.Eval(Container,"Attributes['State']") %>
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
i want to add new items to this radcombo in clientside so i wrote this code:
function updateCombo(result) {
var UnitCombo = $find("<%= UnitCombo.ClientID %>");
var Comitems = UnitCombo.get_items();
Comitems.clear();
var items = result.split('|');
for (var i = 0; i < items.length; i++) {
var temp = items[i].split(',');
UnitCombo.trackChanges();
var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(temp[0]);
comboItem.get_attributes().setAttribute("State", temp[1]);
UnitCombo.get_items().add(comboItem);
UnitCombo.commitChanges();
}
}
items add to radcombo correctly but attribute part does not show,and no script error happen also
items in radcombo just show Unit part....
please help me..thanks
<telerik:RadComboBox DropDownWidth="220px" runat="server" ID="UnitCombo">
<HeaderTemplate>
<table cellpadding="0" width="200px" cellspacing="0">
<tr>
<td style=" width:100px" >unit</td>
<td style="width:100px">ReviseState</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table cellpadding="0" width="200px" cellspacing="0">
<tr>
<td style=" width:100px" >
<%# DataBinder.Eval(Container,"Text") %>
</td>
<td style="width:100px">
<%# DataBinder.Eval(Container,"Attributes['State']") %>
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
i want to add new items to this radcombo in clientside so i wrote this code:
function updateCombo(result) {
var UnitCombo = $find("<%= UnitCombo.ClientID %>");
var Comitems = UnitCombo.get_items();
Comitems.clear();
var items = result.split('|');
for (var i = 0; i < items.length; i++) {
var temp = items[i].split(',');
UnitCombo.trackChanges();
var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(temp[0]);
comboItem.get_attributes().setAttribute("State", temp[1]);
UnitCombo.get_items().add(comboItem);
UnitCombo.commitChanges();
}
}
items add to radcombo correctly but attribute part does not show,and no script error happen also
items in radcombo just show Unit part....
please help me..thanks