[CLOSED] Treepanel inside Dropdown - Set value of Dropdown as selected value of tree

  1. #1

    [CLOSED] Treepanel inside Dropdown - Set value of Dropdown as selected value of tree

    Using client side JavaScript, what is the method to add values for "text" and "value" of a DropdownField? I haven't been able to find it yet and need to set these values when an item is selected in the tree. I can set one or the other (node.id or node.text) but not both. I would like to save the value as id and the display as text.
    Last edited by Daniil; Feb 08, 2011 at 6:57 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please see the following sample
    https://examples1.ext.net/#/Form/Dro...alueText_Mode/
  3. #3
    Thanks... The example will set a value, but the problem is it sets the id as the display value as well. I need to set the id to the number and the display to the text. Here is an example of my set value call:

    tree.Listeners.Click.Handler = "this.dropDownField.setValue(node.id, node.text, false); "

    I have put alerts on this handler and the node.id and node.text do show number and text respectively. Just need the client side statement to actually set the dropdown value and display text correctly.
  4. #4
    Hi,

    I am not sure that clear understood you. The sample from Examples Explorer uses 'node.id' for the value and 'node.text' as display value
    Please provide more details about what difference in that example and your requirements
  5. #5
    On the page I put the control on, I added this to test what values were being saved:

        <DirectMethod()> _
        Public Sub Test_Tree()
            Dim test As String = ""
    
            test = treetest.Value & " - " & treetest.Text
    
            MsgBox(test)
    
        End Sub
    the code used to set the value is this:

    tree.Listeners.Click.Handler = "this.dropDownField.setValue(node.id, node.text, false); " & Me.ID & "_treepanel.hide(); "
    The direct method only displays values for the "treetest.Text" and never anything for "treetest.Value"
  6. #6
    Hi,

    Do you able to reproduce it on standard sample?
    Please provide full test sample which demonstrates the issue
  7. #7
    Finally found the issue, was missing the following on my dropdown:

    Me.Mode = DropDownMode.ValueText
    Can be closed...

Similar Threads

  1. Replies: 2
    Last Post: Mar 13, 2012, 10:23 AM
  2. Replies: 6
    Last Post: Jan 28, 2012, 1:14 AM
  3. Replies: 2
    Last Post: May 14, 2011, 6:29 PM
  4. [CLOSED] TreePanel inside dropdown
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Oct 06, 2010, 6:08 PM
  5. [CLOSED] Define selected Position of dropdown-list in TimeField
    By macap in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 29, 2010, 5:18 AM

Posting Permissions