1、基本使用

<link href="@Url.Content("~/C  ontent/kendo/2014.1.318/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.default.min.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/kendo/2014.1.318/jquery.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/kendo/2014.1.318/kendo.web.min.js")" type="text/javascript"></script>
<input class="color" />
<script type="text/javascript">
$(function () {
var data = [
"Orange",
"White",
"Green",
"Gray"
]; $(".color").kendoAutoComplete({
dataSource: data,
filter: "startswith",
placeholder: "Select color...",
separator: "," // 设置separator之后可以选择多个,未设置时只能选择一个。
});
});
</script>

  效果预览:

  2、构造函数初始化

$("#txtAutoComplete").kendoAutoComplete(["Item1", "Item2", "Item3"]);

  或:

var data = ["Item1", "Item2", "Item3"];
$("#txtAutoComplete").kendoAutoComplete({
dataSource: data
});

  默认的filter为startswith。

  3、加载远程数据

<input id="province" />
<script type="text/javascript">
$(function () {
$("#province").kendoAutoComplete({
dataTextField: "ProvinceName",
dataSource: {
transport: {
read: {
dataType: "json",
url: "/Province/GetProvinceList"
}
}
},
filter: "contains",
placeholder: "--请选择--"
});
});
</script>

  示例中的远程加载为第一次打开页面即进行加载全部的记录。

  效果预览:

KendoUI系列:AutoComplete的更多相关文章

  1. KendoUI系列:Window

    1.基本使用 <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css") ...

  2. KendoUI系列:MultiSelect

    1.基本使用 1>.创建Input <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common. ...

  3. KendoUI系列:DatePicker

    1.基本使用 <link href="@Url.Content("~/C ontent/kendo/2014.1.318/kendo.common.min.css" ...

  4. KendoUI系列:DropDownList

    1.基本使用 1>.创建Input <input id="dropDownList" /> <link href="@Url.Content(&q ...

  5. [转]KendoUI系列:Grid

    本文转自:http://www.cnblogs.com/libingql/p/3774879.html 1.基本使用 <div id="grid"></div&g ...

  6. KendoUI系列:TreeView

    1.加载本地数据 <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css" ...

  7. KendoUI系列:TabStrip

    <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css")" ...

  8. KendoUI系列:PanelBar

    <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css")" ...

  9. KendoUI系列:Grid

    1.基本使用 <div id="grid"></div> <link href="@Url.Content("~/Content/ ...

随机推荐

  1. (转)CentOs上配置samba服务

    前 言 在我们使用 Windows 作为客户机的时候,通常有文件.打印共享的需求.作为Windows 网络功能之一,通常可以在 Windows 客户机之间通过 Windows Network 固有的功 ...

  2. linux 第一题 计算题

    #!/bin/bash echo "输入第一个数字" read A b= ]] do && [[ ${A} != *[!]* ]] then echo " ...

  3. [Leetcode]String to Integer (atoi) 简易实现方法

    刚看到题就想用数组做,发现大多数解也是用数组做的,突然看到一个清新脱俗的解法: int atoi(const char *str) { ; int n; string s(str); istrings ...

  4. 润乾报表之制作List列表

    一般情况洗啊,如果sql查到多条数据,使用表格扩展的方式在一张表格里面(横展.纵展):目前的需求是,以报表为单位,做成List.例如,如果查出3条数据,预览的时候,要有3张格式相同内容有异的报表.如图 ...

  5. 如何安装Docker UCP

    parallels@ubuntu:~/Downloads/Docker$ ls DTR UCP parallels@ubuntu:~/Downloads/Docker$ sudo openssl re ...

  6. 管理我的数据之GDBM

    管理我的数据之GDBM 作者 He YiJun – storysnail<at>gmail.com 团队 ls 版权 转载请保留本声明! 本文档包含的原创代码根据General Publi ...

  7. 重量级Orchard模块发布 - 模块生成工具RaisingStudio.ModuleGenerator

    可以从这里下载安装(http://gallery.orchardproject.net/List/Modules/Orchard.Module.RaisingStudio.ModuleGenerato ...

  8. centos 安装ffmpeg

    wget http://www.ffmpeg.org/releases/ffmpeg-3.1.tar.gz tar -zxvf ffmpeg-3.1.tar.gz cd ffmpeg-3.1 ./co ...

  9. hadoop使用问题

    前提 环境 ubuntu 安装hadoop 已经有一段时间 1.启动的时候提示 Connection reset by peer 这个查看日志,里面有说 ssh里面某个文件的权限太大 这个ssh里修改 ...

  10. 细心很重要---猜猜这个SQL执行的什么意思

    今天在帮客户做语句优化的时候,突然遇到这样一个语句,类似下面的例子(原语句是个update) 例子中使用AdventureWorks数据中的两个表. productID 是[Production].[ ...