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

Checkbox Issue

I am not getting exact checkbox click value.I am using args,when I click on same parent 1st child element I get the correct value but when I click on the 2nd child same parent element,I get the parent name first which is not what I need.Please help

Attachment: src_e8a0d929.zip

3 Replies

CI Christopher Issac Sunder K Syncfusion Team May 21, 2019 01:02 PM UTC

Hi Neha, 

Greetings from Syncfusion support. 

We have tried to debug the sample you provided to us. But could not able to access it due to proxy issues. However, We have checked the reported issue at our end . But could not reproduce it. When we clicked the 2nd child under the same parent element, we can able to get both the parent and child element details. Please check the output image 


Please check the above sample and get back to us with the following details 
  1. Did you remove the parent checkbox in your application while you check/uncheck the node?
  2. You have mentioned “when I click on same parent 1st child element I get the correct value”. What did you mean correct value here?
  3. While clicking on the child node do you wish to get the child node data or parent node data or both?

Thanks, 
Christo 



ND Neha Das replied to Christopher Issac Sunder K May 22, 2019 05:58 AM UTC

Hi Neha, 

Greetings from Syncfusion support. 

We have tried to debug the sample you provided to us. But could not able to access it due to proxy issues. However, We have checked the reported issue at our end . But could not reproduce it. When we clicked the 2nd child under the same parent element, we can able to get both the parent and child element details. Please check the output image 


Please check the above sample and get back to us with the following details 
  1. Did you remove the parent checkbox in your application while you check/uncheck the node?
  2. You have mentioned “when I click on same parent 1st child element I get the correct value”. What did you mean correct value here?
  3. While clicking on the child node do you wish to get the child node data or parent node data or both?

Thanks, 
Christo 


I meant I just want the child node data,the checkbox I am clicking on I want only that data on click.I don't want parent nodes or subchildren nodes to be added in my click method.I want it to be shown whenever I check it or uncheck it.


CI Christopher Issac Sunder K Syncfusion Team May 22, 2019 12:50 PM UTC

Hi Neha, 

If you want to get the child node data which are clicking you can get that data in the nodeChecking event instead of nodeChecked event. Because the nodeChecked event get triggered before the each node is state is successfully checked. So you can get the checked node data alone in that event using following code block 

public nodeChecking(args) { 
    if (args.isInteracted) { 
        debugger 
        console.log(args.data); 
    } 
} 

Please find the corresponding output image. 
 

Note: If you want the check box to behave independently you can make use of autoCheck property 
 

Please get back to us if you need any further assistance. 

Thanks, 
Christo 


Loader.
Live Chat Icon For mobile
Up arrow icon