ligerUI智能提示
来源:互联网 发布:小学生学汉字软件 编辑:程序博客网 时间:2024/06/05 01:53
function GetUser() {
var cache = {};
$("#user").autocomplete({
minLength: 1,
//查找数据源事件
source:function (request, response) {
var term =request.term.trim();
//request.field = $('#city').attr("value");
if (termin cache) {
response(cache[term]);
return;
}
$.getJSON('@Url.Action("GetUser")', request,function (data, status, xhr) {
cache[term] = data;
response(data);
});
},
//选择项事件
select:function (event, ui) {
var item =ui.item;
$('#hid_user').attr("value", item.id);//对隐藏的"hid_user"赋上下拉列表的选中项的id值
}
});
}
[HttpGet]
publicActionResult GetUser()
{
JavaScriptSerializer jss =newJavaScriptSerializer();
List<Model.Sys_Operator>sys_operator_list =newList<Model.Sys_Operator>();
BLL.Sys_Operator bll_sys_operator =new BLL.Sys_Operator();
string strwhere ="";
string t = Request["term"];
strwhere ="[Name] like '%" + t +"%'";//生成搜索条件
sys_operator_list = bll_sys_operator.GetModelList(strwhere);
var cl = sys_operator_list.Select(c =>new
{
label = c.Name,
value = c.Name,
id = c.Id
}).Take(15);
return Json(cl,JsonRequestBehavior.AllowGet);
}
- ligerUI智能提示
- LigerUI
- ligerUI
- LigerUI
- LigerUI
- LigerUI
- LigerUI
- LigerUI
- LigerUI
- 完成智能提示
- myeclipss 智能提示
- JScript智能提示FAQ
- MyEclipse 6.5 智能提示
- 设置Eclipse智能提示
- 不能智能提示
- combobox智能提示框
- NetBean智能提示功能
- 智能提示 模仿google
- JS encodeURI()和encodeURIComponent()区别
- JS NaN属性
- JS Function 属性
- <script>标签说明
- osgearth IOS版本编译
- ligerUI智能提示
- JS dom树链式设计模式
- 页面中关于“充电”状态图片的选择?
- java小知识积累
- Jquery “选择”和“筛选”概念的区分
- js小知识点
- js 模拟“类”继承
- js 类的private public属性
- 我的第一个birt报表