Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150988 | Jan 27,2020 12:36 PM UTC | Jan 30,2020 02:44 AM UTC | ASP.NET Core - EJ 2 | 3 |
![]() |
Tags: Dropdown List |
<ejs-dropdownlist id="dropdown " open="open" noRecordsTemplate="<div id='tree'></div>">
</ejs-dropdownlist>
<script>
function open() {
var treeObj;
var dropdownObj = document.getElementById("dropdown").ej2_instances[0];
dropdownObj.popupObj.element.firstElementChild.className = "e-content overflow";
// rendering the treeview only on first time
if (treeObj == null || treeObj == undefined) {
treeObj = new ej.navigations.TreeView({
fields: { dataSource: localData, id: 'id', parentID: 'pid', text: 'name', hasChildren: 'hasChild' },
// use the nodeselected event to add the text to dropdown's input element.
nodeSelected: function(args){
var drop = document.getElementById("dropdown").ej2_instances[0];
drop.inputElement.value = args.nodeData.text;
}
});
treeObj.appendTo('#tree');
}
}
</script> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.