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

Need only one active content in data grid list [Detailed Template].

Thread ID:

Created:

Updated:

Platform:

Replies:

144292 Apr 29,2019 12:32 PM UTC Apr 30,2019 08:36 AM UTC Angular - EJ 2 1
loading
Tags: Grid
Ebenezer
Asked On April 29, 2019 12:32 PM UTC

Hi,
I want to display the detailed template data grid with only one content expanded and others in collapsed state.
Please check the below link for reference:



Regards,
Ebenezer Justin


Pavithra Subramaniyam [Syncfusion]
Replied On April 30, 2019 08:36 AM UTC

Hi Ebenezer, 
 
Thanks for contacting Syncfusion Support. 
 
We have validated your query. You can achieve your requirement using expand() and collapseAll() method of the detailRowModule  inside the created event of Grid component. Please find the below code snippet. 
 
Please find the below code example, sample and documentation link for your reference. 
 
[component.ts] 
expand() { 
    this.gridObj.element.addEventListener('click', (e)=>{ 
          if(parentsUntil(e.target as Element, 'e-detailrowexpand')) { 
            this.gridObj.detailRowModule.collapseAll(); 
            let row = parentsUntil(e.target as Element , 'e-row'); 
            let rowIndex = parseInt(row.getAttribute('aria-rowindex')); 
            this.gridObj.detailRowModule.expand(rowIndex); 
          } 
    }); 
  } 
 
 
Sample                       https://stackblitz.com/edit/angular-detailtemplate-144292?file=app.component.ts 
 
                                      https://ej2.syncfusion.com/angular/documentation/api/grid#created  
 
Regards, 
Pavithra 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