Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > ComboBox > Treeview in Combobox IE Problem

Not answered Treeview in Combobox IE Problem

Feed from this thread
  • Teoman avatar

    Posted on Feb 5, 2012 (permalink)

    Hi,
    We have treeview with checkbox in combobox.We dont have any problem with chrome and firefox but combobox doesnt closed when we focused out of the control in IE.

    <telerik:RadComboBox ID="cbxDepartments" runat="server" DataTextField="DEPNAME" DataValueField="DEPID"
                                    ExpandAnimation-Type="None" CollapseAnimation-Type="None" OnClientDropDownClosing="OnClientDropDownClosing"
                                    AllowCustomText="True" EmptyMessage="-- seçiniz --">
                                    <ItemTemplate>
                                        <div id="div1">
                                            <telerik:RadTreeView ID="tvDepartments" runat="server" DataTextField="DEPNAME" DataValueField="DEPID"
                                                DataFieldParentID="SUBDEPID" DataFieldID="DEPID" Height="140px" CheckBoxes="true">
                                            </telerik:RadTreeView>
                                        </div>
                                    </ItemTemplate>
                                    <Items>
                                        <telerik:RadComboBoxItem Text="" />
                                    </Items>
                                    <ExpandAnimation Type="Linear"></ExpandAnimation>
                                    <CollapseAnimation Type="None"></CollapseAnimation>
                                </telerik:RadComboBox>

     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function OnClientDropDownClosing(sender, args) {
                    //            if (args.get_node().get_level() == 0)
                    //            {
                    //                args.set_cancel(true);
                    //            }
                    //            else {
                    var item = sender.get_items().getItem(0); // Get the first RadComboBoxItem
                    var treeView = item.findControl('tvDepartments'); // Find your RadTreeView
                    var checkedNodes = treeView.get_checkedNodes(); // Retrieve the checked items in the RadTreeView

                    var newText = '';
                    checkedNodes.forEach(function (node) {  // Loop through the checked nodes. Requires jQuery!
                        if (newText != '') { newText += ', '; }
                        newText += node.get_text();
                    });
                    var comboBox = $find("<%= cbxDepartments.ClientID %>");
                    comboBox.set_text(newText); // Set the RadComboBox text
                    if ($.browser.msie) { // IE sometimes takes two tries for it to respond to new text
                        comboBox.set_text(newText);
                        //                }
                    }
                }
            </script>


    Reply

  • Posted on Feb 5, 2012 (permalink)

    Hello,

    I have tried to reproduce the issue but no avail. Here is the sample code I have tried.
    JS:
    function OnClientDropDownClosing(sender, args)
    {
        var item = sender.get_items().getItem(0);
        var treeView = item.findControl('RadTreeView1');
        var checkedNodes = treeView.get_checkedNodes();
        var newText = '';
        checkedNodes.forEach(function (node)
        
          if (newText != '')
             {
                newText += ', ';
             }
               newText += node.get_text();
       });
       var comboBox = $find("<%= RadComboBox1.ClientID %>");
      comboBox.set_text(newText);
     }

    Thanks,
    Princy.

    Reply

  • Teoman avatar

    Posted on Feb 12, 2012 (permalink)

    anybody help me please.my project dead line cooming soon and no solution yet.

    Reply

  • Teoman avatar

    Posted on Feb 20, 2012 (permalink)

    my problem still hasnt been solved.can you help me please?

    Reply

  • Teoman avatar

    Posted on Feb 28, 2012 (permalink)

    i have still same problem ie gives this error.

    Message: Object doesn't support this property or method
    Line: 15
    Char: 9
    Code: 0

    checkedNodes.forEach(function (node)

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > ComboBox > Treeview in Combobox IE Problem
Related resources for "Treeview in Combobox IE Problem"

ASP.NET ComboBox Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]