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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Setting multi selection(row) in treegrid by code

Thread ID:

Created:

Updated:

Platform:

Replies:

145195 Jun 12,2019 06:34 AM UTC Jun 13,2019 02:04 PM UTC jQuery 1
loading
Tags: ejTreeGrid
Developer
Asked On June 12, 2019 06:34 AM UTC

I didn't find a solution to set the multi selection for rows in the treegrid by code.
I have added a little sample with my problem.
If i click the button some selections should be set in the treegrid (e.g. index 0,2,4).

Some samples shows the the selection can be shown by "....addClass("e-selectionbackground e-active")", but if i add some additional selections (Ctrl+Click), in the rowSelected event the args.model.selectedItems would not return the selections that are only set with "....addClass("e-selectionbackground e-active")".

Is there any possibility to make a multi row select in the treegrid by code where the selectedItems(or an other property) holds the correct selected items?

Regards
Michael

Attachment: EssentialStudioforJavaScript_TreeGridMultiSelect_ed9951db.zip

Jesus Arockia Sankaran S [Syncfusion]
Replied On June 13, 2019 02:04 PM UTC

Hi Michael, 
 
Greetings from Syncfusion support. 
 
In TreeGrid, we can select multiple rows by using selectRows method and by enabling multiSelectCtrlRequest property. And we can get the selected records details by using getSelectedRecords method. 
Please find the code example below. 
<button onclick=selectRow() > Select Rows</button > 
 
function selectRow() { 
            var obj = $("#TreeGridContainer").data("ejTreeGrid"); 
            var index = [0, 2, 4]; 
            for (var i = 0; i < index.length; i++) { 
                obj._multiSelectCtrlRequest = true; 
                obj.selectRows(index[i]); 
            } 
        }; 
 
Please find the below sample link. 
Please get back to us if you require further assistance on this. 
 
Regards, 
Jesus Arockia Sankaran 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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon