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.
Unfortunately, activation email could not send to your email. Please try again.

How to expand a row on single click (on the row)

Thread ID:

Created:

Updated:

Platform:

Replies:

127390 Nov 11,2016 11:30 AM Nov 15,2016 06:26 AM JavaScript 3
loading
Tags: ejTreeGrid
Wolfgang Kamir
Asked On November 11, 2016 11:30 AM

Is there a way to expand a treegrid row, when the user clicks anywhere on the row (instead of directly on the little triangle).

It feels a bit tedious to hav to exactly target the triangle.

Thanks,
Wolfgang

Jonesherine Stephen [Syncfusion]
Replied On November 14, 2016 04:10 AM

Hi Wolfgang, 
Thanks for contacting Syncfusion support 
Query1: Is there a way to expand a TreeGrid row, when the user clicks anywhere on the row (instead of directly on the little triangle). 
Solution: In TreeGrid, We can expand/collapse the selected row by using expandCollapseRow” method. 
We have prepared the work around and in “rowSelected” client side event we have expanded/collapsed the records. 
Please find the code example below: 
$("#TreeGridContainer").ejTreeGrid({               
                   // 
                rowSelected: function (args) { 
            //To expand/collapse the selected row 
   $("#TreeGridContainer").ejTreeGrid("expandCollapseRow", this.selectedRowIndex()); 
            }); 
        }); 
Query2: It feels a bit tedious to have to exactly target the triangle. 
Solution1: We can customize the expander/collapse icon as per our requirement. 
We have prepared the work around and incremented the default size of the expander/collapse icon.   
Please find the code example below: 
<style> 
        .e-treegrid .e-treegridcollapse:before { 
            font-size: 16px; 
            margin-top: -3px; 
        } 
        .e-treegrid .e-treegridexpand:before { 
            font-size: 12px !important; 
            margin-top: -1px; 
        } 
    </style> 
Solution2: We can also replace the expander/collapse icons with custom icons/images by using Column Template support in TreeGrid. 
Please find our online sample for your reference: 
We have also prepared the sample for your reference. Please find the sample from below location 
 
Please let us know if you need further assistance on this. 
Regards, 
Jone sherine P S 


Wolfgang Kamir
Replied On November 14, 2016 04:29 AM

Hello Jane,

thanks so much for your assistance - works great!

It seems to me that

$("#TreeGridContainer").ejTreeGrid("expandCollapseRow"this.selectedRowIndex());

calls an internal method - since it is not really documented anywhere....  is this a valid assumption?
And if this is an internal method.... is there any trick I could use to find out about other internal methods (even on other controls) in general?

I have a feeling that there is a lot of hidden potential ready to be explored - instead of creating a support ticket every time something is not public availble ;-)

Kind regards,
Wolfgang






Jonesherine Stephen [Syncfusion]
Replied On November 15, 2016 06:26 AM

Hi Wolfgang, 
Thanks for your update. 
Please find the response below: 
Query1: Is there any trick I could use to find out about other internal methods (even on other controls) in general? I have a feeling that there is a lot of hidden potential ready to be explored - instead of creating a support ticket every time something is not public available. 
Solution:  
Please find the our online documentation to refer the properties, public methods and events available in EJ controls 
Please find our knowledge base and online demo samples for your reference: 
Query2: since it is not really documented anywhere....  is this a valid assumption? 
Solution: “expandCollapseRow” is a valid public method in ejTreeGrid. But currently we are enhancing our online documentations with updated changes. We will let you once our documentation has been refreshed. 
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.

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.

;