<script type="text/x-jsrender" id="columnTemplate"> <span>{{:TitleOfCourtesy}}{{:FirstName}}-{{:LastName}}</span> </script> </head> <body ng-controller="regularization_controller"> <div ej-grid id="Grid" e-width="500px" e-datasource="dataManager" > <div e-columns> <div e-column e-field="EmployeeID" e-headertext="Employee ID" e-width="60px" e-isprimarykey="true" e-textalign="left"></div> <div e-column e-headertext="Name" e-template="true" e-templateid='template' e-textalign="left" e-width="120"></div> <div e-column e-field="BirthDate" e-width="120px" e-headertext="Birth Date" textalign="left" e-format="{0:MM/dd/yyyy}"></div> <div e-column e-field="Title" e-width="120px" e-headertext="Title" textalign="left"></div> </div> </div> <script> angular.module('listCtrl', ['ejangular']) .controller('regularization_controller', function ($scope) { $scope.dataManager = window.employeeView; $scope.template = "#columnTemplate"; }); |
<div ej-grid id="Grid" e-width="500px" e-datasource="dataManager" > <div e-columns> …. <div e-column e-field="CustomerDetails.0.FirstName" e-width="120px" e-headertext="Title" textalign="left"></div> …. </div> |
<script type="text/x-jsrender" id="columnTemplate"> {{>~Append(CustomerDetails)}} <script> …. $.views.helpers({ Append: function (args) { name = args[0].TitleOfCourtesy + args[0].FirstName + "-" + args[0].LastName; return name; } });
|
We can achieve the template concept in ListBox component using “template” property.
Please refer the below code snippet
[html] <ul id="bookSelect" ej-listbox e-datasource="dataList" e-value="value" e-height="200px" e-template='template'></ul> |
[script] <script type="text/javascript"> angular.module('ListCtrl', ['ejangular']) .controller('ListBoxCtrl', function ($scope) { $scope.dataList = window.employeeView; $scope.value = ""; $scope.template = '${TitleOfCourtesy} ${FirstName}-${LastName}'; });
|