JSFiddle - React, Tailwind, and code Playground
by doriansao
HTML
<script src="http://cdn.kendostatic.com/2012.2.710/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.default.min.css">
<div id="grid" style="width: 700px; margin: 0 auto;"></div>
<script id="popup_editor" type="text/x-kendo-template">
<label for="Agency">Agency:</label>
<input name="Agency"
data-bind="value:Agency"
data-value-field="AgencyId"
data-text-field="AgencyName"
data-source="agencyDataSource"
data-role="autocomplete" />
</script>
JavaScript
var agencyDataSource = new kendo.data.DataSource({
data: [
{ AgencyId: 1, AgencyName: 'Dorian Agency1' },
{ AgencyId: 2, AgencyName: 'Dean Agency2' },
{ AgencyId: 3, AgencyName: 'Omar Agency3' },
{ AgencyId: 4, AgencyName: 'Vanessa Agency4' },
{ AgencyId: 5, AgencyName: 'Rob Agency5' },
{ AgencyId: 6, AgencyName: 'Cecilia Agency6' }
]
});
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
data: [],
schema: {
model: {
fields: {
Agency: { type: "string" }
}
}
}
},
pageable: false,
editable: {
mode: "popup",
template: $("#popup_editor").html()
},
edit: function(e) {
$(e.container)
.find("input[name='Agency']")
.data("kendoAutoComplete")
.bind("change", function(e) {
console.log("auto complete changed");
});
},
toolbar: ["create"],
columns: [
{ field: "Agency", title: "Agency" },
{ command: ["edit", "destroy"], title: "", width: "300px" }
]
});
});