KendoUI系列:AutoComplete
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的更多相关文章
- KendoUI系列:Window
1.基本使用 <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css") ...
- KendoUI系列:MultiSelect
1.基本使用 1>.创建Input <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common. ...
- KendoUI系列:DatePicker
1.基本使用 <link href="@Url.Content("~/C ontent/kendo/2014.1.318/kendo.common.min.css" ...
- KendoUI系列:DropDownList
1.基本使用 1>.创建Input <input id="dropDownList" /> <link href="@Url.Content(&q ...
- [转]KendoUI系列:Grid
本文转自:http://www.cnblogs.com/libingql/p/3774879.html 1.基本使用 <div id="grid"></div&g ...
- KendoUI系列:TreeView
1.加载本地数据 <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css" ...
- KendoUI系列:TabStrip
<link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css")" ...
- KendoUI系列:PanelBar
<link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css")" ...
- KendoUI系列:Grid
1.基本使用 <div id="grid"></div> <link href="@Url.Content("~/Content/ ...
随机推荐
- [UCSD白板题] Changing Money
Problem Introduction In this problem,you will design an algorithm for changing money optimally. Prob ...
- MATLAB常用操作
1.点乘,点除,点乘方 点乘(对应元素相乘),必须同维或者其中一个是标量,a.*b 点除,a.\b表示矩阵b的每个元素除以a中对应元素或者除以常数a,a./b表示常数a除以矩阵b中每个元素或者矩阵a除 ...
- iOS开发之AppIcon及LaunchScreen设置
一.AppIcon设置 具体设置步骤如下图: 二.LaunchScreen设置与停留时间设置 具体设置步骤如下图: 通过程序可以增加背景的停留时间:
- bzoj 3718
题意:戳这里 思路:很容易发现对于一个车能否移动到最终的位置只要判断路径中得最大高度与自身高端之和是否>w即可. 那么就可以转化为逆序对得最大数问题..即对于每一辆车,判断有那些最初在他前面,而 ...
- Linux内核--网络栈实现分析(三)--驱动程序层+链路层(上)
本文分析基于Linux Kernel 1.2.13 原创作品,转载请标明http://blog.csdn.net/yming0221/article/details/7497260 更多请看专栏,地址 ...
- PN结的单向导电性及PN结的电流方程及PN结电容
PN结加正向电压 当PN结外加正向电压时,外电场将多数载流子推向空间电荷区,使其变窄,削弱了内电场,破坏了原来的平衡,使扩散运动加剧,PN结导通.PN结的压降只有零点几付,所以在其回路里应串联一个电阻 ...
- 调试SQLSERVER (一)生成dump文件的方法
调试SQLSERVER (一)生成dump文件的方法 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置调试SQLSERVER (三)使用Windbg调试SQLSERVER ...
- Java构建工具Ant小记(一)
Ant简介 Ant是基于java的构建工具.理论上来说它类似与make工具,但是却克服了make的一些固有的缺陷. 传统的Make是基于操作系统shell的构建工具,虽然也可以基于工作的os对make ...
- 【TypeScript】如何在TypeScript中使用async/await,让你的代码更像C#。
[TypeScript]如何在TypeScript中使用async/await,让你的代码更像C#. async/await 提到这个东西,大家应该都很熟悉.最出名的可能就是C#中的,但也有其它语言也 ...
- 【腾讯bugly干货分享】Android自绘动画实现与优化实战——以Tencent OS录音机波形动
前言 本文为腾讯bugly的原创内容,非经过本文作者同意禁止转载,原文地址为:http://bugly.qq.com/bbs/forum.php?mod=viewthread&tid=1180 ...