Kendo UI AutoComplete Example

Contoh kode javascript menggunakan Kendo UI AutoComplete

[code language=”javascript”]
var assigneeValid = false;
$("#Assignee").kendoAutoComplete({
placeholder: "Silakan Pilih",
dataTextField: "Text",
filter: "contains",
minLength: 2,
dataSource: new kendo.data.DataSource({ data: @Html.Raw(Model.GetAssigneeOptionsAsJson()) }),
open: function(e){
assigneeValid = false;
},
select: function (e) {
var item = e.item;
var dataItem = this.dataItem(e.item.index());
$("#Assignee").val(dataItem.Text);
assigneeValid = true;
},
close: function(e){
if(!assigneeValid) this.value(”);
},
});

[/code]

http://stackoverflow.com/questions/13564336/kendo-autocomplete-force-users-to-make-valid-selection

Chandra Oemaryadi has written 244 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>