Hello,
I am trying to get the "change" event for the Treeview control, but it is not working like an usual dropdown list. Could you help me with the corret code for that?
I am trying something like this:
$("#ddtree").on('change', function () {}
But it is not working. I went through the forum issues and the documentation but could no find the answer.
Regards,
Alexandre
|
Platform |
Demo link |
UG link |
API link |
|
EJ1 TreeView |
|||
|
EJ2 TreeView |
Hello,
I am sorry for not being more specific regarding what I am using. It is the EJ2 controls. And I believe that what I need is the nodeClick event, to be able to get the value and the text of the selected node.
I could not do it myself with the provided documentation, and I would appreciate if you could send me just the sample function in Jquery that detect the select event and retrieve the required information.
Regards,
Alexandre
|
<ejs-treeview id="listdata" nodeClicked="onClick" nodeSelected="onSelect">
<e-treeview-fields dataSource="ViewBag.dataSource" id="id" parentId="pid" text="name" hasChildren="hasChild" expanded="expanded"></e-treeview-fields>
</ejs-treeview>
<script>
function onClick(args)
{
console.log(args.node);
}
function onSelect(args)
{
console.log(args.nodeData); // get node data
}
</script> |
Hello Keerthana,
Thank you very much for that sample. It is exactly what I needed.
Regards,
Alexandre