or
.k-grid td
{
padding
:
0
;
}
{ "RowSet": {
"Key": "7256bd2d-879f-494b-a7c0-f0d6ed2eba84",
"Rows": [
{ "RowNum": 1, "Name": "Fred", "Value": 123 },
{ "RowNum": 2, "Name": "Mary", "Value": 323 },
{ "RowNum": 3, "Name": "John", "Value": 732 },
{ "RowNum": 4, "Name": "Sue", "Value": 895 }
]
}
}
schema: {
data: "RowSet.Rows",
model: {
id: "RowNum",
fields: {
Key: { editable: false, type: "string", path="..\Key" or path="this.parent().Key" }
RowNum: { editable: false, type: "number" },
Name: { editable: true, type: "string" },
Value: { editable: true, type: "number" },
}
}
$("#customer").kendoAutoComplete({
minLength: 2,
dataTextField: "CustomerId",
animation: {
open: {
effects: "fadeIn",
duration: 300,
show: true
}
},
filter: "contains",
change: onChange,
select: onSelect,
placeholder: "Search.....",
template: '<
div
><
div
class
=
"arrow"
></
div
>' +
// '<
span
>#=FirstName# #=LastName#</
span
> <
span
>#=CustomerId#</
span
>'
'<
span
>#=FirstName# #=LastName#</
span
>'
+
'</
div
>',
dataSource: {
serverFiltering: true,
transport: {
read: {
url: "/API/Customer/Get",
dataType: "json",
data: function () {
return {
data: $("#customer").data("kendoAutoComplete").value()
};
}
}
}
}
});
function onSelect(e) {
console.log("on select");
var autocomplete = $("#customer").data("kendoAutoComplete");
var value = autocomplete.value();
doMyFunctionForSelect(value);//maybe its to soon to be calling this
}
function onChange(e) {
console.log("on change");
console.log(e);
var autocomplete = $("#customer").data("kendoAutoComplete");
var value = autocomplete.value();
if (value.length > 0) {
var last = e.sender._last;
if (last == 13) {
doMyFunctionForFormSubmit();
}
}
}
Anyone else seeing this behavior? This is really becoming a show stopper for us.