Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142833 | Feb 21,2019 09:47 AM UTC | Apr 2,2019 12:27 PM UTC | Angular - EJ 2 | 8 |
![]() |
Tags: Grid |
@Html.EJS().Grid("FlatGrid").DataSource((IEnumerable<object>)ViewBag.dataSource).QueryCellInfo("querycellinfo").Columns(col =>
{
col.HeaderText("Row Numer").Width("90").Add();
col.Field("EmployeeID").HeaderText("Employee ID").IsPrimaryKey(true).Width("120").Add();
col.Field("CustomerID").HeaderText("Customer Name").Width("150").Add();
col.Field("OrderDate").HeaderText("Order Date").Type("date").Width("110").Add();
col.Field("Freight").HeaderText("Freight").EditType("numericedit").Width("120").Add();
col.Field("ShipCountry").HeaderText("Ship Country").Width("150").Add();
}).AllowPaging().Render()
<script>
var count = 1;
function querycellinfo(args) {
if (args.column.headerText == "Row Numer") {
args.cell.innerHTML = count;
count++;
}
}
</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.