easyui combobox实现本地模糊查询
2016-10-20 10:12
591 查看
var _time_out = null; $("#txt1").combobox({ valueField : "value", textField : "text", height : 32, method : "get", editable : true, keyHandler : { query : function (q) { if (_time_out) { clearTimeout(_time_out); } _time_out = setTimeout(function () { var opts = $("#txt1").combobox('options'); var data = $("#txt1").combobox("getData"); var value = $("#txt1").combobox("textbox").val(); $.each(data, function (k, node) { if (node[opts.textField].indexOf(value) >= 0) { //$("#txt1").combobox("select",node[opts.valueField]); //$("#txt1").combobox("setValue", node[opts.valueField]); var item = $("#txt1").combobox("panel").panel("body").find("div").filter(function () { return $(this).html() == node[opts.textField]; }); if (item) { clearTimeout(_time_out); _time_out = null; $("#txt1").combobox("panel").panel("body").scrollTop(item.position().top); $("#txt1").combobox("select", node[opts.valueField]); return false; } } }) clearTimeout(_time_out); _time_out = null; }, 500); } }, data : [{ "value" : "1001001", "text" : "泗水县" }, { "value" : "1001002", "text" : "嘉祥县" }, { "value" : "1001003", "text" : "市中区" }, { "value" : "1001004", "text" : "兖州市" }, { "value" : "1001005", "text" : "金乡县" }, { "value" : "1001006", "text" : "曲阜市" }, { "value" : "1001007", "text" : "梁山县" }, { "value" : "1001008", "text" : "微山县" }, { "value" : "1001009", "text" : "市辖区" }, { "value" : "10010010", "text" : "汶上县" }, { "value" : "10010011", "text" : "鱼台县" }, { "value" : "10010012", "text" : "任城区" }, { "value" : "10010013", "text" : "邹城市" } ] });
技术交流QQ群:15129679
相关文章推荐
- easyui修改源码实现combobox的真正模糊查询
- 使用easyUI的combogrid来实现模糊查询,jsp部分
- 章鱼哥出品_VB.NET ComboBox、 TextBox 实现自动完成、自动过滤 模糊查询的功能
- 【EasyUI】combotree和combobox模糊查询
- easyUi和ext comBoBox的模糊查询 (支持拼音和汉字)
- 目标实现:模糊查询本地文件,并作删除处理
- jquery-easyui组件combobox模糊查询在IE中数据太多导致浏览器崩溃
- 0018-【EasyUI】combotree和combobox模糊查询
- easyui combobox和combotree模糊查询 (偷来的。。。)
- easyui-combobox实现级联查询
- Easyui 实现智能模糊查询(智能检索)
- Winform如何实现ComboBox模糊查询
- easyUi和ext comBoBox的模糊查询 (支持拼音和汉字)
- 实现combobox模糊查询的时候报错 InvalidArgument=“0”的值对于“index”无效
- springMVC+easyUI实现combobox动态级联查询
- winform中ComboBox利用AutoComplete属性实现模糊查询(有缺陷)
- easyui-combobox---ajax获取数据库JSON数据,实现搜索框实时显示模糊搜索结果
- Easyui combobox 源码修改模糊查询v=1.34
- easyui combobox模糊查询
- easyui combobox 左匹配模糊查询