代码之家  ›  专栏  ›  技术社区  ›  asif

如何获取所选选项的数据

  •  0
  • asif  · 技术社区  · 6 年前

    https://www.jqueryscript.net/demo/Drop-Down-Combo-Tree/

    enter image description here

    我拿不到它的身份证。我怎么办。?

    没有适当的文件可用于此。有什么办法我能得到它吗。?

    <input type="text" id="justAnotherInputBox"
     placeholder="Type to filter" ng-change="showSummery(this)"/>
    
    
    
    $scope.showSummery = function (data) {
            console.log(data)
    };
    
    2 回复  |  直到 6 年前
        1
  •  1
  •   Henk de Vries    6 年前

    您可以在 <li> <input>

    $('#justAnotherInputBox')
        .parents('div.comboTreeWrapper')
        .find('div.comboTreeDropDownContainer')
        .on('click','li.ComboTreeItemChlid',function() {
       var id=$(this).find('span').attr('data-id');
       /* the rest of your code */
    });
    

    请注意“ComboTreeItemChlid”输入错误。它也在插件中。

        2
  •  1
  •   Pratheesh M    6 年前

    试试这个,

     <input type="text" id="justAnotherInputBox"
         placeholder="Type to filter" ng-change="showSummery()"/>
    
    
    
        $scope.showSummery = function () {
                console.log(document.getElementById("justAnotherInputBox").value)
        };
    
        3
  •  0
  •   Ali Rasouli    5 年前

    如果使用底部代码定义组合树:

        var comboTree2;
     comboTree2 = $('#justAnotherInputBox').comboTree({
            source: dataJson,
            isMultiple: false
        });
    

    comboTree2._selectedItem.id