Tak wynika z komentarza Usunąłem mój poprzedni odpowiedź - używając zdarzenie rozmycia na polach wejściowych (lub innych elementów) wydaje się działać:
W zdarzeniu grid.edit użyj jquery, aby powiązać z polem tekstowym (lub innym inline edit control), zdarzenie blur, które jest uruchamiane po utracie ostrości. Dodaj to do definicji siatki ... i oczywiście zamień alert na swój kod.
edit: function (e) {
alert('Edit Fired');
$('input.k-input.k-textbox').blur(function() {
alert('blur event called');
});
},
Przetestowałem to modyfikując przykładowy kod inline edycji here
Moje pełne lokalne źródło edit - widzą tylko wydarzenie EDIT na def Grid:
<div id="example" class="k-content">
<div id="grid"></div>
<script>
$(document).ready(function() {
var crudServiceBaseUrl = "http://demos.kendoui.com/service",
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl + "/Products",
dataType: "jsonp"
},
update: {
url: crudServiceBaseUrl + "/Products/Update",
dataType: "jsonp"
},
destroy: {
url: crudServiceBaseUrl + "/Products/Destroy",
dataType: "jsonp"
},
create: {
url: crudServiceBaseUrl + "/Products/Create",
dataType: "jsonp"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
batch: true,
pageSize: 20,
schema: {
model: {
id: "ProductID",
fields: {
ProductID: { editable: false, nullable: true },
ProductName: { validation: { required: true } },
UnitPrice: { type: "number", validation: { required: true, min: 1 } },
Discontinued: { type: "boolean" },
UnitsInStock: { type: "number", validation: { min: 0, required: true } }
}
}
}
});
$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 430,
toolbar: ["create"],
// added in hook to here to bind to edit element events.
// blur is fired when an element loses focus
edit: function (e) {
alert('Edit Fired');
$('input.k-input.k-textbox').blur(function (e) {
alert('blur event called');
});
},
columns: [
"ProductName",
{ field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "100px" },
{ field: "UnitsInStock", title: "Units In Stock", width: "100px" },
{ field: "Discontinued", width: "100px" },
{ command: ["edit", "destroy"], title: " ", width: "172px" }],
editable: "inline"
});
});
</script>
</div>
Od czasu wydania tego numeru przez trzy lata, a firma Telerik nie dostarczyła oficjalnego rozwiązania - czy w Teleriku otworzyłeś opcję funkcji? W siatce występuje zdarzenie "itemChange", ale jest ono nieudokumentowane i nie podaje nazwy kolumny. – Rolf