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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamic Accordion header and content templates

Thread ID:

Created:

Updated:

Platform:

Replies:

143081 Mar 4,2019 12:36 PM UTC Mar 5,2019 11:05 AM UTC Angular - EJ 2 1
loading
Tags: Accordion
Unknown
Asked On March 4, 2019 12:36 PM UTC

Hello,

Is it possible to set values dynamically to header templates and content templates?

I have accordion:

<ejs-accordion #acrdnInstance (expanding)="expanding($event)">
<e-accordionitems>
<e-accordionitem expanded='true' [header]="header" [content]='content' cssClass="e-custom">
</e-accordionitem>
</e-accordionitems>
</ejs-accordion>

My templates:

<ng-template #header>
<h1>TextValueToInsert</h1>
<p id="text">TextValueToInsert2</p>
</ng-template>

<ng-template #content>
<div id="nested_accordion"></div>
</ng-template>

Thanks,
Br Volodymyr



Karthigeyan Krishnamurthi [Syncfusion]
Replied On March 5, 2019 11:05 AM UTC


Thanks for contacting Syncfusion support.   
  
Yes, it is possible and kindly add the item as item model using the addItem public method to achieve your requirement. Please find the below code snippet for more reference.  
  
public clicktoadd(e) {  
    // give the item as item model with header and content property   
    var items = { header: 'NewHeader', content: 'NewContentAdded' };   
    this.acrdnInstance.addItem(items); // add the item using addItem  
}  
  
We have also prepared a sample for your reference below.    

Regards,
 
Karthigeyan


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

;