or
@(Html.Kendo().Grid(m)
.Name(gridName)
.BindTo(m)
.ToolBar(commands => commands.Create().Text(newButtonText))
.Events(e => e.Edit("onGridCellEdit" + gridName))
.DataSource(dataSource => dataSource.Ajax().Events(ev => ev.Change("onDataSourceChange" + gridName))
.Model(model =>
{
model.Id(p => p.ID);
model.Field(p => p.Function).DefaultValue((KeyValueObjectViewModel)ViewData[SAPController.GRID_DDL_PROPERTY_FUNCTION + "_Default"]);
model.Field(p => p.SAPClientEmpty).DefaultValue((KeyValueObjectViewModel)ViewData[SAPController.GRID_DDL_PROPERTY_SAP_CLIENT_EMPTY + "_Default"]);
model.Field(p => p.Person).DefaultValue(new ResultEntryViewModel(true, false));
}).ServerOperation(false)
)
.Columns(columns =>
{
columns.Bound(p => p.Function).ClientTemplate("#=Function.Name#").Width(200).Title(Strings.ColumnFunction);
columns.Bound(p => p.SAPClientEmpty).ClientTemplate("#=SAPClientEmpty.Name#").Width(200).Title(Strings.ColumnSAPClient);
columns.Bound(p => p.Person).ClientTemplate("#=Person.Name#").Title(Strings.ColumnPerson);
columns.Template(@<
text
></
text
>).Width(20).ClientTemplate(TemplateConstants.GRID_CLIENTTEMPLATE_DELETE_COLUMN);
})
.Editable(editing => editing.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Bottom))
)
<
system.web.extensions
>
<
scripting
>
<
webServices
>
<
jsonSerialization
maxJsonLength
=
"2147483647"
/>
</
webServices
>
</
scripting
>
</
system.web.extensions
>
JavaScriptSerializer ser = new JavaScriptSerializer();
ser.MaxJsonLength = Int32.MaxValue;
// TODO: Do the Kendo Grid serialization ...
@model IEnumerable<
DigiBob.Model.Governance.RolesResponsibilities.RoleName
>
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Name);
})
.Pageable()
.Sortable()
.Scrollable(scr=>scr.Height(430))
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(false)
)
)
RoleNameRepository _roleNameRepository = new RoleNameRepository(new DigiBobContext());
public ActionResult Index()
{
return View(_roleNameRepository.GetAll());
}
Minutes Early/Late: @if(#: PODInfo.MinutesEarlyLate # > 0){ #: PODInfo.MinutesEarlyLate # Late } else { On Time }
@(Html.Kendo().Grid<
GMCRepository.Models.DataServices.ShipmentInformation
>().Name("ShipmentList")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("ShipmentInfoList", "DataInquiry"))
)
.Columns(columns =>
{
columns.Bound(shipment => shipment.TrackingNumber);
columns.Bound(shipment => shipment.ShipDate);
columns.Bound(shipment => shipment.ShipperInformation.Address.City);
columns.Bound(shipment => shipment.ShipperInformation.Address.StateProvince);
columns.Bound(shipment => shipment.RecipientInformation.Address.City);
columns.Bound(shipment => shipment.RecipientInformation.Address.StateProvince);
columns.Bound(shipment => shipment.AmountDue);
columns.Bound(shipment => shipment.BillingInfo.BillToAccount);
columns.Bound(shipment => shipment.CustomerReference);
})
.ClientDetailTemplateId("shipmentDetail-template")
)
<
script
id
=
"shipmentDetail-template"
type
=
"text/x-kendo-template"
>
<
div
class
=
"shipment-grid-detail"
>
<
div
class
=
"row-fluid"
>
<
div
class
=
"span4 shipment-div"
>
<
h4
>Shipper Information</
h4
>
#: ShipperInformation.Name # <
br
/>
#: ShipperInformation.Company # <
br
/>
#: ShipperInformation.Address.AddressLine1 # <
br
/>
#: ShipperInformation.Address.AddressLine2 # <
br
/>
#: ShipperInformation.Address.City #, #: ShipperInformation.Address.State # #: ShipperInformation.Address.PostalCode #, #: ShipperInformation.CountryCode #
</
div
>
<
div
class
=
"span4 shipment-div"
>
<
h4
>Recipient Information</
h4
>
#: RecipientInformation.Name # <
br
/>
#: RecipientInformation.Company # <
br
/>
#: RecipientInformation.Address.AddressLine1 # <
br
/>
#: RecipientInformation.Address.AddressLine2 # <
br
/>
#: RecipientInformation.Address.City #, #: RecipientInformation.Address.State # #: RecipientInformation.Address.PostalCode #, #: RecipientInformation.CountryCode #
</
div
>
<
div
class
=
"span4 shipment-div"
>
<
h4
>Shipment Information</
h4
>
Ship Date: #: ShipDate # <
br
/>
Service: #: PackageInfo.Service # <
br
/>
Packaging: #: PackageInfo.PackageDescription # <
br
/>
Actual Weight: #: PackageInfo.ActualWeight.Weight # #: PackageInfo.ActualWeight.WeightUnit # <
br
/>
Billed Weight: #: PackageInfo.BilledWeight.Weight # #: PackageInfo.BilledWeight.WeightUnit # <
br
/>
Dimensions: #: PackageInfo.dimensions.DimLength # x #: PackageInfo.dimensions.DimWidth # x #: PackageInfo.dimensions.DimHeight # #: PackageInfo.dimensions.DimUOM # <
br
/>
Pieces: #: PackageInfo.Pieces #
</
div
>
</
div
>
<
div
class
=
"row-fluid"
>
<
div
class
=
"span4 shipment-div"
>
<
h4
>Delivery Information</
h4
>
POD Date: #: PODInfo.PODDate # <
br
/>
POD Name: #: PODInfo.PODSignature # <
br
/>
Minutes Early/Late: @if(#: PODInfo.MinutesEarlyLate # > 0){ #: PODInfo.MinutesEarlyLate # Late } else { On Time }
</
div
>
<
div
class
=
"span4 shipment-div"
>
<
h4
>Billing Information</
h4
>
Payment Option: #: BillingInfo.PaymentOption # <
br
/>
Zone: #: BillingInfo.CarrierZone # <
br
/>
Bill To Account: #: BillingInfo.BillToAccount # <
br
/>
Payment File Ref: #: BillingInfo.PaymentReference # <
br
/>
Closing Run: #: BillingInfo.PaymentRefFileName # <
br
/>
Bundle Number: #: BillingInfo.BundleNumber #
</
div
>
<
div
class
=
"span4 shipment-div"
>
<
h4
>Charge Information</
h4
>
<
div
class
=
"row-fluid"
>
<
div
class
=
"span6"
>
Original Amount: <
br
/>
Credits: <
br
/>
Refunds: <
br
/>
Amount Due:
</
div
>
<
div
class
=
"span6"
>
#: OriginalAmount # <
br
/>
#: Credits # <
br
/>
#: Refunds # <
br
/>
#: AmountDue #
</
div
>
</
div
>
<
div
class
=
"row-fluid"
>
@(Html.Kendo().Grid<
GMCRepository.Models.DataServices.ChargesInformation
>().Name("ShipmentCharges")
.DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("ChargesList", "DataInquiry"))
)
.Columns(columns =>
{
columns.Bound(charge => charge.ChargeDescription);
columns.Bound(charge => charge.ChargeAmount);
})
.ToClientTemplate())
</
div
>
</
div
>
</
div
>
<
div
class
=
"row-fluid"
>
<
div
class
=
"span4 shipment-div"
>
<
h4
>Cost Center Information</
h4
>
Cost Center: #: BillingInfo.CostCenter # <
br
/>
Match Type: #: BillingInfo.CostCenterMatchType # <
br
/>
</
div
>
<
div
class
=
"span4 shipment-div"
>
<
h4
>References</
h4
>
</
div
>
</
div
>
</
div
>
</
script
>
@(Html.Kendo().Grid(Model)
.Name("grdProducts")
.Columns(columns =>
{
columns.Bound(p => p.Name);
columns.Bound(p => p.ProductType);
columns.Bound(p => p.SellStartDate);
columns.Bound(p => p.SellEndDate);
columns.Command(command => command.Edit()).Width(160);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable
.Mode(GridEditMode.PopUp)
.DisplayDeleteConfirmation(true)
.TemplateName("ProductEditor")
.Window(w => w
.Width(700)
.Title("Edit Product")))
.Pageable(pa => pa.Numeric(false).PageSizes(new [] {5,10,20}))
.Scrollable(scr => scr.Height(430).Virtual(false))
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
.DataSource(dataSource => dataSource
.Ajax()
.AutoSync(false)
.Batch(false)
.PageSize(20)
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.Id).Editable(false);
model.Field(p => p.CategoryName).Editable(false);
model.Field(p => p.ProductType).DefaultValue((int)ProductTypeEnum.Cameras);
})
.Create(create => create.Action("EditingCreate", "Product"))
.Read(read => read.Action("EditingRead", "Product"))
.Update(update => update.Action("EditingUpdate", "Product"))
)
)
@model _ProductStore.Infrastructure.Models.Products.Product
@{
ViewBag.Title = "Edit";
}
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<
fieldset
>
... all labels and fields...
</
fieldset
>
}
<
input
name
=
"__RequestVerificationToken"
type
=
"hidden"
data-bind
=
"value:__RequestVerificationToken"
value
=
""
/>