zoukankan      html  css  js  c++  java
  • jqueryautocomplete自动匹配

    在autocomplete完成自动匹配时,可以使用result方法,来完成其他关联操作!

    例:
    $('#keyword').autocomplete(emails, { 
        max: 12, //列表里的条目数 
        minChars: 0, //自动完成激活之前填入的最小字符 
         400, //提示的宽度,溢出隐藏 
        scrollHeight: 300, //提示的高度,溢出显示滚动条 
        matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示 
        autoFill: false, //自动填充 
        formatItem: function(row, i, max) { 
            return i + '/' + max + ':"' + row.name + '"[' + row.to + ']';
        }, 
        formatMatch: function(row, i, max) { 
            return row.name + row.to; 
        }, 
        formatResult: function(row) { 
            return row.to; 
        } 
    }).result(function(event, row, formatted) { 
        alert(row.to);
         /*在这个地方填写赋值事件
          *JQ("#文本id").attr("value", row.to);
          */
    });
  • 相关阅读:
    批处理文件 bat
    批处理文件 搜索指定路径文件拷贝出去
    css 表格
    jquery面试题
    indexedDB使用
    页面加载及优化
    Ajax,restful/Rest JSON和JSONP
    数组去重
    删除数组里大于3的元素
    判断一个字符串中出现次数最多的字符,统计这个次数
  • 原文地址:https://www.cnblogs.com/someonehere/p/2701402.html
Copyright © 2011-2022 走看看