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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TreeGrid get data from selected boxes

Thread ID:

Created:

Updated:

Platform:

Replies:

127563 Nov 23,2016 11:08 AM UTC Nov 29,2016 06:03 PM UTC JavaScript 3
loading
Tags: ejTreeGrid
RI
Asked On November 23, 2016 11:08 AM UTC

Hello,

i have a problem, i need to use the checkbox selection.

How do i get all the selected rows to an array.

is there a function to call to see what the user has selected?
I´ve tried the selectedRows but its allways triggered on click in the row.


greetings.

Jonesherine Stephen [Syncfusion]
Replied On November 24, 2016 03:17 PM UTC

Hi Ruzic, 
Thanks for contacting Syncfusion support 
Query: How do i get all the selected rows to an array.is there a function to call to see what the user has selected? 
Solution: In “selectedItems“property we can get the checked records collection in TreeGrid. We have prepared the sample and alerted the checked record length for your reference. 
Please find the code example below: 
  <button onclick="clickme()" style="margin-bottom:10px">Checked Items</button> 
<script type="text/javascript"> 
  function clickme() { 
            var treeObj = $("#TreeGridContainer").ejTreeGrid("instance"), 
                //to get the checked items collection 
            checkedItems = treeObj.model.selectedItems; 
            alert(checkedItems.length); 
        }     
</script> 
Please find the sample from below location 
 
Regards, 
Jone sherine P S 


RI
Replied On November 28, 2016 03:19 PM UTC

Perfect!!!!!!

Thank you.

is there a way to unselect the boxes after
treeObj.refresh(); ?

Jonesherine Stephen [Syncfusion]
Replied On November 29, 2016 06:03 PM UTC

Hi Ruzic, 
By using “selectAllRows” public method we can check/uncheck the records in TreeGrid. For this we need to set “enableSelectAll” property as true in selectionSettings. 
Please find the code example below: 
<button onclick="uncheck()">To Uncheck</button> 
function uncheck() {            
            var treeObj = $("#TreeGridContainer").ejTreeGrid("instance"); 
                //to get the checked items collection 
            treeObj.selectAllRows(false);            
        } 
We have also prepared the sample based on this. Please find the sample from below location 
 
Regards 
Jone sherine P S 


CONFIRMATION

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.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;