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

Dynamic cards

Thread ID:

Created:

Updated:

Platform:

Replies:

143016 Feb 28,2019 02:25 PM UTC Mar 1,2019 11:42 AM UTC ASP.NET Core - EJ 2 3
loading
Tags: Card
Erik
Asked On February 28, 2019 02:25 PM UTC

Hi,

Looking at your demo for EJ2 tileview cards (https://aspdotnetcore.syncfusion.com/Card/TileView#/material);

I would like to add a card for each row of a database's table, and fill them with data from said rows.

Do you have a documentation regarding this ?

Thanks

Karthigeyan Krishnamurthi [Syncfusion]
Replied On March 1, 2019 09:59 AM UTC

Hi Erik,

Thanks for contacting Syncfusion support.   
  
We have prepared below sample to create dynamic cards using the remote data source in button click action.  
  
  
<script type="text/template" id="template"> 
  
    <div class="e-card"> 
        <div class="e-card-title">${FirstName}</div> 
        <div class="e-card-header"> 
            <div class="e-card-header-caption"> 
                <div class="e-card-header-title">${Country}</div> 
                <div class="e-card-sub-title">${Title}</div> 
            </div> 
        </div> 
        <div class="e-card-content"> ${Notes}</div> 
    </div> 
  
</script> 
  
  
<script type="text/javascript"> 
  
  
    function Myclick() { 
  
  
        const SERVICE_URI ='https://js.syncfusion.com/ejServices/Wcf/Northwind.svc/Employees'; 
  
        // your database service using the EJ2 datamanager 
        new ej.data.DataManager({ url: SERVICE_URI, adaptor: new ej.data.ODataAdaptor }) 
            .executeQuery(new ej.data.Query()).then((e) => { 
  
                var result = e.result; 
                var TemplateFn = ej.base.compile(document.getElementById('template').innerHTML.trim()); 
                
                 // bind that result data to each cards 
  
                result.forEach(function (data, index) { 
                    card = TemplateFn(data); 
                    cardEle = document.getElementById('card_sample_' + (++index)); 
                    if (cardEle) { 
                        cardEle.appendChild(card[0]); 
                    } 
                }); 
            }); 
    } 
  
</script> 
  
  
Regards,
 
Karthigeyan


Erik
Replied On March 1, 2019 11:30 AM UTC

Hi Karthigeyan,

Thanks for your answer.

Karthigeyan Krishnamurthi [Syncfusion]
Replied On March 1, 2019 11:42 AM UTC

Hi Erik,

Thanks for your update. 
  
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

Live Chat Icon For mobile
Live Chat Icon