首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

select2 api参数的文档

// 加载数据 $("#e11").select2({ placeholder: "Select report type", allowClear: true, data: [{id: 0, text: 'story'},{id: 1, text: 'bug'},{id: 2, text: 'task'}] }); // 加载数组 支持多选 $("#e11_2").select2({ createSearchChoice:function(term, data) { if ($(data).filter(function() { return this.text.localeCompare(term)===0; }).length===0) {return {id:term, text:term};} }, multiple: true, data: [{id: 0, text: 'story'},{id: 1, text: 'bug'},{id: 2, text: 'task'}] }); function log(e) { var e=$("

  • "+e+"
  • "); $("#events_11").append(e); e.animate({opacity:1}, 10000, 'linear', function() { e.animate({opacity:0}, 2000, 'linear', function() {e.remove(); }); }); } // 对元素 进行事件注册 $("#e11") .on("change", function(e) { log("change "+JSON.stringify({val:e.val, added:e.added, removed:e.removed})); }) // 改变事件 .on("select2-opening", function() { log("opening"); }) // select2 打开中事件 .on("select2-open", function() { log("open"); }) // select2 打开事件 .on("select2-close", function() { log("close"); }) // select2 关闭事件 .on("select2-highlight", function(e) { log ("highlighted val="+ e.val+" choice="+ JSON.stringify(e.choice));}) // 高亮 .on("select2-selecting", function(e) { log ("selecting val="+ e.val+" choice="+ JSON.stringify(e.choice));}) // 选中事件 .on("select2-removing", function(e) { log ("removing val="+ e.val+" choice="+ JSON.stringify(e.choice));}) // 移除中事件 .on("select2-removed", function(e) { log ("removed val="+ e.val+" choice="+ JSON.stringify(e.choice));}) // 移除完毕事件 .on("select2-loaded", function(e) { log ("loaded (data property omitted for brevity)");}) // 加载中事件 .on("select2-focus", function(e) { log ("focus");}) // 获得焦点事件 .on("select2-blur", function(e) { log ("blur");}); // 失去焦点事件 $("#e11").click(function() { $("#e11").val(["AK","CO"]).trigger("change"); }); 官网文档地址是:http://select2.github.io/select2/#documentation。说再多也没用,最后我们来个实例来证明一下ajax请求远程数据,以截图为准:

    05

    [LeetCode] Longest Common Prefix 最长公共前缀 [LeetCode] Longest Common Prefix 最长公共前缀

    链接:https://leetcode.com/problems/longest-common-prefix/#/description 难度:Easy 题目:14. Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. 翻译:编写一个函数来查找给定字符串数组中最长的公共前缀。 思路:取出给定字符串数组中长度最小的一个字符串(或者直接取出第一个字符串),以此为基准,遍历整个字符串数组,若基准字符串是其他所有字符串的子串,则基准字符串即为所求最长公共前缀,否则,将基准字符串截去最后一个字符,重新遍历整个字符串数组,依此类推,直到找到所有字符串数组都存在的子串为止。 参考代码:

    02

    C语言之冒泡排序

    这是一个简单的例子,我再提供十道题供大家计算 给定一个整数数组,请对其进行升序排序。 给定一个浮点数数组,请对其进行降序排序。 给定一个字符串数组,请按字典序对其进行排序。 给定一个二维数组,请按每一行进行升序排序。 给定一个包含大写字母的字符串数组,请按字母顺序对其进行排序。 给定一个包含小写字母的字符串数组,请按字母顺序对其进行排序。 给定一个包含多个数字和字母的字符串数组,请按字母顺序和数字大小对其进行排序。 给定一个包含多个字符串的数组,其中一些字符串是其他字符串的前缀,请按字典序和非前缀关系对其进行排序。 给定一个包含多个日期字符串的数组,请按日期的先后顺序对其进行排序。 给定一个包含多个邮箱地址的数组,请按邮箱地址的字母顺序对其进行排序。

    01

    数组的一些总结

    数组是什么? 数组是一段连续的储存单元。 一维数组 定义 类型 变量名[ 数组长度]; 声明(初始化) 类型 变量名[ 数组长度] = {,}; 引用 变量名[ 下标](下标不能超过定义的长度,且下标从0开始) 应用 1:排序(比较大小) 2: 二维数组 定义 类型 变量名[行长度][列长度]; 声明(初始化) 类型 变量名[行长度][列长度] = {,}; 引用 变量名[行下标][列下标](下标不能越界,从0开始) 应用 1:井字棋判断输赢 2:排序 3: 字符数组 定义 char ch[]; char ch[][]; 特有 输入getchar();(可作为读入多余空格时使用) scanf()格式符为%c 输出putchar(); printf(); 字符串(数组) 双引号内的所有符号统称为字符串,字符串最后有一个空字符’\0’,不占字符串的长度。 c语言本身没有字符串数组类型 定义 char str[]; char str[][]; 声明 字符类型 字符串数组名[] = " "; 引用 整体引用str; 单独引用str[下标]; 输入 scanf()时不加取地址符,格式符为%s,键盘输入空格时结束输入 gets(字符串名); 键盘输入回车时结束输入 输出 printf(); puts(字符串数组名); 应用 1:进制转换时避免数据溢出 2:检查单词个数 3:判断是否是水仙花数 4:输入身份证号输出生日

    01
    领券