zoukankan      html  css  js  c++  java
  • Layui-select中的搜索下拉框lay-search 出现了重复的值

    使用了lay-search 搜索时出现了重复的值

    解决办法

    <select id="Category_select" name="ManagementType" lay-verify="" lay-search>
    <option value="" selected="selected"></option>
    </select>

        
    layui.use(['form', 'layer'], function () { var $ = layui.jquery , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块 var form = layui.form; $.ajax({ type: "POST", url: "/Personnel/DepartParent", data: null, dataType: 'json', success: function (result) { var datas = ""; var data = result.data; for (var i = 0; i < data.length; i++) { debugger; datas += "<option value='" + data[i].Code + "'>" + data[i].DeptName + "</option>"; } $('#Category_select').append(datas); form.render('select'); }, error: function (error) { $.modal.alertWarning("获取模版数据失败"); } }); });

      

  • 相关阅读:
    随笔
    洛谷
    洛谷
    洛谷
    (水题)洛谷
    洛谷
    (水题)洛谷
    洛谷
    (水题)洛谷
    (水题)洛谷
  • 原文地址:https://www.cnblogs.com/BabyRui/p/13932226.html
Copyright © 2011-2022 走看看