Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142987 | Feb 27,2019 04:51 PM UTC | Feb 28,2019 11:40 AM UTC | ASP.NET Core - EJ 2 | 1 |
![]() |
Tags: DataGrid |
<ejs-grid id="Grid" dataSource="ViewBag.dataSource" allowPaging="true" >
<e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true"></e-grid-editSettings>
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
<e-grid-column field="CustomerID" headerText="Customer ID" width="100"></e-grid-column>
<e-grid-column field="EmployeeID" headerText="Employee ID" template="#coltemplate" width="100"></e-grid-column>
<e-grid-column field="Freight" width="100" ></e-grid-column>
<e-grid-column field="Verified" headerText="Verified" width="100"></e-grid-column>
</e-grid-columns>
</ejs-grid>
<script id="coltemplate" type="text/template" >
<span>${format(data)}</span> // we pass row data to the format function
</script>
<script>
var format = function (value) {
var intl = new ej.base.Internationalization();
var emp = 100;
var formattedValue = intl.formatNumber(value.EmployeeID/emp, {
format: 'P2' }); // Format teh template value and also we made the calculation in here
return formattedValue;
}
</script>
|
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.
This page will automatically be redirected to the sign-in page in 10 seconds.