Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145812 | Jul 9,2019 01:34 PM UTC | Jul 11,2019 04:05 AM UTC | ASP.NET MVC | 3 |
![]() |
Tags: Grid |
@(Html.EJ().Grid<Object>("FlatGrid")
…………………………………………………………
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Add();
col.Field("CustomerID").HeaderText("Customer ID").Add();
col.Field("Amount").HeaderText("Amount").DefaultValue(0).Add();
col.Field("Freight").HeaderText("Freight").EditType(EditingType.NumericEdit).DefaultValue(45).Add();
col.Field("ShipCountry").HeaderText("Ship Country").DefaultValue("Brazil").Add();
})) |
@(Html.EJ().Grid<Object>("FlatGrid")
………………………………………………
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Type("number").Add();
col.Field("CustomerID").HeaderText("Customer ID").EditType(EditingType.StringEdit).Type("string").Add();
col.Field("Freight").HeaderText("Freight").Type("number").Add();
col.Field("ShipCountry").HeaderText("Ship Country").Type("string").Add();
col.Field("OrderDate").HeaderText("Order Date").EditType(EditingType.Datepicker).Type("date").Format("{0:MM/dd/yyyy}").Add();
}))
|
@(Html.EJ().Grid<Object>("FlatGrid")
………………………………………………………………………
.ClientSideEvents(e=>e.BeforeBatchSave("BeforeBatchSave"))
.Columns(col =>
{
……………………………………………………….
}))
<script>
function BeforeBatchSave(args) {
if (ej.isNullOrUndefined(args.batchChanges.added[0].Freight)) {
args.batchChanges.added[0].Freight = 0; // set the value here.
}
}
</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.