We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Event only in the last nodes

Hi,


How can I have the event node-select = "onNodeSelected" is the last node, because
When selecting any node, it sends me to call the event and I only want it for the
last nodes.







Example

2019
     January
           Node one
           Node two
     February
           Node three
           Node four

I only want the event for the nodes (Node one, node two, node 3 and node 4)

Or what other event can I use for the last nodes

Regards!





3 Replies

DL Deepa Loganathan Syncfusion Team January 30, 2019 01:17 PM UTC

Hi Corazon, 

Thanks for contacting Syncfusion support. 

We have checked your requirement - "To trigger node-select event for last nodes alone in TreeView". In our TreeView component, the node-select event is triggered on selecting any node. However you can find if the selected Node is the last item and perform action based on that as given in the below code.  

<script> 
function onNodeSelected(args) { 
if (!this.hasChildNode(args.currentElement[0])){ 
//Perform your required operations here 
} 
} 
</script> 

Please check it and get back to us if you have any concerns. 

Regards,
Deepa L. 



CC Corazon Cruz Sanchez February 1, 2019 05:35 PM UTC

Hi Deepa,

My problem was solved, thank you very much.

Regards,


SI Silambarasan I Syncfusion Team February 4, 2019 09:03 AM UTC

Hi Corazon, 
 
Thanks for your update. We are happy to hear that your requirement has been achieved. 
Please get back to us if you need any further assistance. 
 
Regards, 
Silambarasan 


Loader.
Live Chat Icon For mobile
Up arrow icon