Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141174 | Nov 28,2018 09:36 AM UTC | Feb 4,2019 07:18 AM UTC | ASP.NET MVC - EJ 2 | 7 |
![]() |
Tags: Grid |
@Html.EJS().Grid("Grid"). Columns(col =>
{
col.Field("CustomerID").HeaderText("Customer Name").Width("150").Add();
col.Field("Freight").HeaderText("Freight").Width("160").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("ShipCountry").HeaderText("Ship Country").Width("140").Add();
}).AllowPaging().PageSettings(page => { page.PageCount(5); }).Aggregates(agg=> { agg.Columns(new List<Syncfusion.EJ2.Grids.GridAggregateColumn>() { new Syncfusion.EJ2.Grids.GridAggregateColumn() { Field = "Freight", Type = "Custom", FooterTemplate = " Sum of Freight:${Custom}", CustomAggregate= "customAggregateFn" }
. . ..
<script>
var sumofFreight = 0;
function customAggregateFn(data) {
data.result.filter(function (item) {
sumofFreight += item['Freight']
});
if (sumofFreight > 100) {
return 'is exceed sum value more than 100'
}
else {
return sumofFreight;
}
}
</script> |
@Html.EJS().Grid("gDailyTimeSheet").Load(‘load’). . ..Render();
function load() {
this.columns[1].validationRules = { required: true, minLength: [customFn, 'Incorrect value'] };
}
function customFn() {
//Return true if the condition fails.
}
|
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.