@model ProductModel
@if (Model.Id > 0)
{
<table class="adminContent">
<tr>
<td>
<div id="customers-grid"></div>
<script>
$(document).ready(function () {
$("#customers-grid").kendoGrid({
dataSource: {
type: "json",
transport: {
read: {
url: "@Html.Raw(Url.Action("ProductCustomPriceModelList", "Product", new { productId = Model.Id }))",
type: "POST",
dataType: "json",
data: addAntiForgeryToken
}
,
update: {
url:"@Html.Raw(Url.Action("ProductCustomPriceModelUpdate", "Product"))",
type: "POST",
dataType: "json",
data: addAntiForgeryToken
},
destroy: {
url: "@Html.Raw(Url.Action("ProductCustomPriceModelDelete", "Product"))",
type: "POST",
dataType: "json",
data: addAntiForgeryToken
}
},
schema: {
data: "Data",
total: "Total",
model: {
id: "Id",
fields: {
Id: { type: "number" },
CurrencyId: {editable: false, type: "number" },
Price: {editable: true, type: "number" },
OldPrice: {editable: true, type: "number" },
ProductCost: {editable: true, type: "number" },
SpecialPrice: {editable: true, type: "number" },
SpecialPriceStartDateTimeUtc: {editable: true, type: "date" },
SpecialPriceEndDateTimeUtc: {editable: true, type: "date" }
}
}
},
error: function(e) {
display_kendoui_grid_error(e);
this.cancelChanges();
},
pageSize: 10,
serverPaging: true,
serverFiltering: true,
serverSorting: true
},
pageable: {
refresh: true,
pageSizes: 10
},
scrollable: false,
columns: [
{
field: "CurrencyId",
title: "CurrencyId",
//integer format
//format: "{0:0}",
width: 50
}, {
field: "Price",
title: "Price",
//integer format
//format: "{0:0}",
width: 50
}, {
field: "OldPrice",
title: "OldPrice",
//integer format
///format: "{0:0}",
width: 50
}, {
field: "ProductCost",
title: "ProductCost",
//integer format
// format: "{0:0}",
width: 50
}, {
field: "SpecialPrice",
title: "SpecialPrice",
//integer format
//format: "{0:0}",
width: 50
}, {
field: "SpecialPriceStartDateTimeUtc",
title: "SpecialPriceStartDateTimeUtc",
type: "date",
format: "{0:G}",
width: 50
}, {
field: "SpecialPriceEndDateTimeUtc",
title: "SpecialPriceEndDateTimeUtc",
type: "date",
format: "{0:G}",
width: 50
}
,
{ command: ["edit", "destroy"], title: " ", width: "160px" }
]
});
});
</script>
</td>
</tr>
</table>
}
else
{
No Data
}