Thank you Tsvetomir, but I tryed to add activate event, I have same problem.
<!-- >> DETTAGLIO MOVIMENTI ARTICOLO-->
<
script
>
$(function () {
$(".k-grid-excel").on("click", function (e) {
var grid = $("#itemGrid").getKendoGrid();
kendo.ui.progress(grid.element, true);
$("#textSearchButton").addClass("k-state-disabled");
$("#dateFilterDatepicker").addClass("k-state-disabled");
$("#brandComboBox").addClass("k-state-disabled");
$("#tipologyComboBox").addClass("k-state-disabled");
});
})
function onRequestEnd(e) {
var grid = $("#itemGrid").getKendoGrid();
setTimeout(function () {
kendo.ui.progress(grid.element, false);
$("#textSearchButton").removeClass("k-state-disabled");
$("#dateFilterDatepicker").removeClass("k-state-disabled");
$("#brandComboBox").removeClass("k-state-disabled");
$("#tipologyComboBox").removeClass("k-state-disabled");
});
}
function onActivateIleWindow(e) {
var grid = $("#ileGrid").data("kendoGrid").value();
grid.resize();
}
//Recupera il codice articolo
function itemNoData() {
//alert($("#itemNoKey").val());
var itemNoGet = $("#itemNoKey").val();
var selectedDate = $("#dateFilterDatepicker").data("kendoDatePicker").value();
var purchase = $("#purchaseKey").val();
return {
itemNo: itemNoGet,
dateFilter: selectedDate,
purchaseFilter: purchase
}
}
//Invia al template il codice articolo ed apre la window
function showDetails(e) {
e.preventDefault();
$("#purchaseKey").val("false");
//alert($("#purchaseKey").val());
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var wnd = $("#itemLedgerEntriesWindow").data("kendoWindow");
var title = "Movimenti magazzino di " + dataItem.No;
wnd.title(title);
var detailsTemplate = kendo.template($("#ileTemplate").html());
wnd.content(detailsTemplate(dataItem));
wnd.center().open();
}
//Invia al template il codice articolo ed apre la window
function showPurchaseDetails(e) {
e.preventDefault();
$("#purchaseKey").val("true");
//alert($("#purchaseKey").val());
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var wnd = $("#itemLedgerEntriesWindow").data("kendoWindow");
var title = "Movimenti magazzino di " + dataItem.No;
wnd.title(title);
var detailsTemplate = kendo.template($("#ileTemplate").html());
wnd.content(detailsTemplate(dataItem));
wnd.center().open();
}
//In apertura effettua l'aggiornamento del datasource della grid
/*function onActivateIleWindow() {
var grid = $("#ileGrid").data("kendoGrid");
grid.dataSource.read(); // rebind the Grid's DataSource
}*/
</
script
>
<!--Template della window relativa ai dettagli-->
<
input
type
=
"hidden"
id
=
"purchaseKey"
name
=
"purchaseKey"
value
=
"false"
/>
<
script
type
=
"text/x-kendo-template"
id
=
"ileTemplate"
>
<
input
type
=
"hidden"
id
=
"itemNoKey"
name
=
"itemNoKey"
value
=
"#= No #"
/>
@(Html.Kendo().Grid<
ItemLedgerEntryModel
>()
.Name("ileGrid")
.Filterable()
.AutoBind(true)
.Columns(columns =>
{
columns.Bound(f => f.DocumentNo);
columns.Bound(f => f.OrderNo);
columns.Bound(f => f.VendorNo);
columns.Bound(f => f.PostingDate).Format("{0:dd/MM/yyyy}");
columns.Bound(f => f.EntryType);
columns.Bound(f => f.UnitOfMeasureCode);
columns.Bound(f => f.Quantity).Format("{0:N2}").HtmlAttributes(new { style = "text-align: right;" });
})
.ToolBar(tools => tools.Excel())
.Excel(excel => excel
.FileName("MovimentiContabiliArticoli.xlsx")
.Filterable()
.AllPages(true)
)
.Sortable() // Enable sorting
.Pageable()
//.Scrollable(scrollable => scrollable.Virtual(true))
.DataSource(dataSource => dataSource //Configure the Grid data source.
.Ajax() //Specify that Ajax binding is used.
.PageSize(25)
.ServerOperation(true)
.Read(read => read.Action("LedgerEntries", "ItemLedgerEntry").Data("itemNoData"))
).ToClientTemplate()
)
</
script
>
<!--Window dei dettagli dell'articolo-->
@(Html.Kendo().Window()
.Name("itemLedgerEntriesWindow")
.Title("Movimenti Magazzino")
//.LoadContentFrom("GetItemLedgerEntries", "Home")
.Visible(false)
//.Iframe(true)
.Height(600)
.Width(1100)
//.Resizable()
//.Draggable()
.Modal(true)
.Events(e=>e.Activate("onActivateIleWindow"))
)
<!-- << DETTAGLIO MOVIMENTI ARTICOLO-->