Saturday 15 May 2010

asp.net - Telerik RadComboBox javascript API problem -


I am having trouble using RadComboBox's JavaScript API and not, I have jQuery or any other There is no power to switch over the setting. It is enough to say that now there is no hair left on my head: P

In short I selected the selected index of a RadComboBox I want to capture, and want to update another RadComboBox in this index. for example. First, the selection of a value in RCB automatically updates the other on the client side. My problem is actually that I do not find any way to set the index on the other RCB, even if the docs says that there is an easy way to do this .. (you have heard that the first is correct)

I have followed API docs on this page (), and I've used the excellent firebug in JavaScript debugger and Firefox in IE8. I'm techie vibe I am using the UI assembly version 2009.2.826.20

I do not need a complete source to solve, but pointing to the right direction would be greatly appreciated! :)

Here are some example codes I have cooked together:


  ; Var index = item.get_selectedIndex (); DetailCB.SetSelected (index); // method does not exist, but should be in accordance with docs.} & Lt; / Script & gt; & Lt; Div & gt; & Lt; Taylor: RadComboBox ID = "MasterCube" Runat = "Server" OnClientSelectedIndexChanged = "masterChanged" & gt; & Lt; Items & gt; & Lt; Taylor: RadComboBoxItem Text = "One" Value = "1" runat = "server" /> & Lt; Taylor: RadComboBoxItem text = "two" value = "2" runat = "server" /> & Lt; Taylor: RadComboBoxItem text = "three" value = "3" runat = "server" /> & Lt; / Item & gt; & Lt; / Telerik: RadComboBox & gt; & Lt; / Div & gt; & Lt; Div & gt; & Lt; Taylor: RadComboBox ID = "DetailCB" runat = "server" & gt; & Lt; Items & gt; & Lt; Taylor: RadComboBoxItem Text = "One" Value = "1" runat = "server" /> & Lt; Taylor: RadComboBoxItem text = "two" value = "2" runat = "server" /> & Lt; Taylor: RadComboBoxItem text = "three" value = "3" runat = "server" /> & Lt; / Item & gt; & Lt; / Telerik: RadComboBox & gt; & Lt; / Div & gt; & Lt; / Form & gt;  

I do not need a complete source to solve, but a kick in the right direction will be highly appreciated! :)

Many thanks for Veselin Vasilev and Steefet for your input, JS debugging and Diet Cup coffee After many hours I found it to work with IE8 and FF3.5.

The correct JavaScript event handler to update the parallel radcombobox (answer to the selected combination of indexed indexes):

  Function MasterChat (Sender, e) {Var detailCB = $ find ("& lt;% = DetailCB.ClientID%>"); Var item = e.get_item (); Var index = item.get_index (); // Receive individually allDetailItems = detailCB.get_items (); Var itemoutEx = all the delitititis.GetItim (index); See detailed in item // See CB item.inx Selection (); }  

By making multiple calls on one line it can definitely be small, I can have a way to do this with less code like this, but I have to do almost everything Tried and this is the only solution that works for me.


No comments:

Post a Comment