zoukankan      html  css  js  c++  java
  • aotocomplete

    /*==========加载时执行的语句==========*/  $(function () {      $.getJSON("JsonHandler.ashx", {}, function (json) {          initAutoComplete(json);      })  });  

     function initAutoComplete(json) {      $("#suggest1").autocomplete(json, {             minChars: 1,             matchCase: false, //不区分大小写"JsonHandler.ashx"             autoFill: false,             max: 10,             formatItem: function (row, i, max, term) {                // row = eval("(" + row + ")"); "JsonHandler.ashx"                 var v = $("#suggest1").val();                 return row.name + " (" + row.code + ")";                 if (row.code.indexOf(v) == 0 || row.spell.indexOf(v) == 0) {                     return row.name + " (" + row.code + ")";                 }                 else                     return false;             },             formatMatch: function (row, i, max) {               //  row = eval("(" + row + ")");                 return row.name + " (" + row.code + ")";             },             formatResult: function (row) {                // row = eval("(" + row + ")");                 return row.name + " (" + row.code + ")";             },             reasultSearch: function (row, v)//本场数据自定义查询语法 注意这是我自己新加的事件             {               //  row = eval("(" + row + ")");                 //自定义在code或spell中匹配                 if (row.data.code.indexOf(v) >= 0 || row.data.spell.indexOf(v) >= 0||row.data.name.indexOf(v)>=0 ) {                     return row;                 }                 else                     return false;             }         });     }

  • 相关阅读:
    EzHttp 流传输调用代码示例
    使用EzHttp框架 开发基于HTTP协议的CS轻应用
    [转]Installing Memcached on Windows
    SQLiteServer+SQLiteClient 用于.Net项目的SQLite服务端程序和客户端类库
    ERROR: Pillow-5.2.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
    Linux下的tar压缩解压缩命令详解
    scp 基于 SSH 的安全远程服务器文件拷贝
    大批量删除列表中元素的方法,自己用本办法做的
    Python 列表 pop() 方法
    可遍历的数据对象enumerate() 方法的使用
  • 原文地址:https://www.cnblogs.com/cjmtt/p/2848217.html
Copyright © 2011-2022 走看看