set_text is not allways working on first try

2 posts, 0 answers
  1. Mattias
    Mattias avatar
    263 posts
    Member since:
    Aug 2012

    Posted 07 Nov 2011 Link to this post

    Hi,
    I'm using this code:
    function nodeClicking(sender, eventArgs) {
       var comboBox = $find("<%= radComboBoxUnits.ClientID %>");
       var node = eventArgs.get_node()
       node.set_selected(true);
       comboBox.set_text(node.get_text());
       comboBox.hideDropDown();
    }

    But sometimes I need to click twice on a node for the text to show up in the combobox.
    I click once, and the combobox collapses but the combobox text is still the old one.
    I open the combobox again and clicks on a node, this time the text is showing up.
    Why is that? Can I change this code for any other "working" code?

    Most of the times it works as it should, but sometimes, randomized, it's not working.

    Regards,
    Mattias
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Nov 2011 Link to this post

    Hello Mattias,

    You can try the following javascript.

    JS:
    <script type="text/javascript">
     function OnClientNodeClicking(sender, args)
      {
        var nodetxt = args.get_node().get_text();
        var combo = $find("<%= RadComboBox1.ClientID %>");
        combo.set_text(nodetxt);
      }
    </script

    Thanks,
    Princy.
Back to Top