or
public class ItemModel { public ItemModel() { ServiceBookList = new List<ServiceModel>(); } public List<ServiceModel> ServiceBookList { get; set; }}public class ServiceModel{ public ServiceModel() { } public int RefServiceID { get; set; } public string Value { get; set; } public string Code { get; set; } public long EnterpriseProductServiceBookID { get; set; } public long AppUserProductServiceBookID { get; set; } public bool IsDeleted { get; set; }}function SaveProductBook() {
//This is called when the "Save" button on the parent grid is clicked
var productBook = $("#AdminProductBookGrid").data("kendoGrid"); SaveProductDetailViews(productBook); //Save items located in detail template productBook.dataSource.sync(); } function SaveProductDetailViews(itemGrid) { //For each row in grid, grab the latest data from the fields within the detail templates //and update the row's dataSource prior to sync $.each($("#AdminProductBookGrid tbody tr"), function (index, row) { var dataItem = itemGrid.dataItem(row); var detailRow = $(row).next(); if (dataItem != null && detailRow.has('.k-detail-cell').length > 0) { SaveServiceDetailViews(dataItem, detailRow, type); } }); }function SaveServiceDetailViews(dataItem, detailRow, type) { var serviceGrid = $(detailRow).find("div[id=ServiceGrid_" + dataItem.uid + "]").data("kendoGrid"); //data is the item's added in the detail template's grid for that parent row var data = serviceGrid.dataSource._data; for(var i = 0; i < data.length; i++) { //Add to the parent row's dataSource list dataItem.ServiceBookList.push(data[i]); } }<div id="dlgUpload" style="display:none"> <p><span class="ui-icon ui-icon-info" style="float: left; margin: 0 7px 20px 0;"></span>Photo Upload</p> <div style="width:100%;max-height:300px;"> @(Html.Kendo().Upload() .Name("fileUpload") .Async(a => a .Save("Save", "Upload") .Remove("Remove", "Upload") .AutoUpload(true) ) .Events(e => e .Upload(@<text> function(e) { e.data = { jobNumber: $("#Customer_Number").val(), mode:"photos" }; } </text>) .Remove(@<text> function(e) { e.data = { jobNumber: $("#Customer_Number").val(), mode:"photos" }; } </text>) ) ) </div></div>
function uploadPhotos(customerId) { $("#dlgUpload").dialog({ autoOpen: false, resizable: false, draggable: true, modal: true, width: 470, title: "Upload Photos for Customer " + customerId, buttons: { "Close": function () { $(this).dialog("close"); } }, }); $('#dlgUpload').dialog('open');}.ui-dialog .k-upload-button input{ z-index:auto !important;}
Events(e => e.Edit("getKey()"))
.ToolBar(commands =>
{
commands.Create().HtmlAttributes(new { onclick = "getKey()" });
})
<script type="text/javascript"> kendo.culture(//here is my culture); </script>.ToolBar(toolbar =>
{
toolbar.Template(
@{
if(centre.AttributeCenterRels.Count < 6) {
@<div class="action text-align-right">
<a href="~/AttributCentreRel/Create?CentreId=@centre.Id" class="btn"><i class="icon-plus"></i> Create</a>
</div>
}
else{
@<div class="action text-align-right">
Vous ne pouvez spécifier que 6 attributs pour un centre.
</div>
}
}
);
})
Is this possible?
Regards,