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. Image for the cookie policy date
close icon

Knockout example using Card Template

Is there any demos with Knockout and custom templates, and in particular binding card fields to the template?

Regards
Jason Coley

1 Reply

BS Buvana Sathasivam Syncfusion Team April 17, 2017 10:52 AM UTC

  
Hi Jason,   
  
Thanks for using Syncfusion products.   
  
Templates are used to create custom card layout as per your convenience.  HTML templates can be specified in the template property of the cardSettings as an ID of the template’s HTML element.  Kanban fields property can be used for mapping fields from the dataSource.  If you are wish to customize the Kanban card, then use cardSettings property.  Please refer to the following code.   

  
  
<div id="Kanban" data-bind="ejKanban: {……  
                                 cardSettings: card   
                                    }"></div>   // binding values from ViewModel to HTML elements   
   
 
  
  
<script id="cardtemplate" type="text/x-jsrender">               // Here customize the Kanban card 
        <table class="e-templatetable">   
           <colgroup>   
               <col width="10%">   
               <col width="90%">   
          </colgroup>   
          <tbody>   
           <tr>               
            <td class="details">   
                <table>   
                    <colgroup>   
                        <col width="10%">   
                        <col width="90%">   
                    </colgroup>   
                    <tbody>   
                        <tr>   
                            <td class="CardHeader"><b>   Assignee:</b></td>   
                            <td>{{:Assignee}}</td>   
                        </tr>                         
                        <tr>   
                            <td class="CardHeader"><b>   Summary: </b></td>   
                            <td>{{:Summary}}</td>   
                        </tr>   
                        <tr>   
                            <td class="CardHeader"><b>   Type: </b></td>   
                            <td>{{:Type}}</td>   
                        </tr>                           
                    </tbody>   
                </table>   
            </td>   
           </tr>   
        </tbody>   
    </table>        
    </script>   
 
  
  
var card = {   
                    template: "#cardtemplate",         // Template loading              
                };   
   
window.kanbanData = {   
        ……   
                card: ko.observable(card),                      // update underlying ViewModel data   
        ……   
};   
 
  

Please refer to the following UG document: https://help.syncfusion.com/js/kanban/cards#template   
  
API documents:    
  
Please refer to the following link: https://www.jsviews.com/#jsobservable    
  
We have prepared a Kanban sample demo with template for your reference.   
  
   
Regards,   
Buvana S.   
 


Loader.
Live Chat Icon For mobile
Up arrow icon