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

Event only in the last nodes


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.


           Node one
           Node two
           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


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.  

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

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

Deepa L. 

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

Hi Deepa,

My problem was solved, thank you very much.


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. 

Live Chat Icon For mobile
Up arrow icon