<bdo id='xgLsw'></bdo><ul id='xgLsw'></ul>
    <tfoot id='xgLsw'></tfoot>

    <i id='xgLsw'><tr id='xgLsw'><dt id='xgLsw'><q id='xgLsw'><span id='xgLsw'><b id='xgLsw'><form id='xgLsw'><ins id='xgLsw'></ins><ul id='xgLsw'></ul><sub id='xgLsw'></sub></form><legend id='xgLsw'></legend><bdo id='xgLsw'><pre id='xgLsw'><center id='xgLsw'></center></pre></bdo></b><th id='xgLsw'></th></span></q></dt></tr></i><div id='xgLsw'><tfoot id='xgLsw'></tfoot><dl id='xgLsw'><fieldset id='xgLsw'></fieldset></dl></div>

    <legend id='xgLsw'><style id='xgLsw'><dir id='xgLsw'><q id='xgLsw'></q></dir></style></legend>

      1. <small id='xgLsw'></small><noframes id='xgLsw'>

      2. 改造layui tree组件支持树的关键字搜索操作

        时间:2024-10-26

          • <legend id='zIh0j'><style id='zIh0j'><dir id='zIh0j'><q id='zIh0j'></q></dir></style></legend>
            1. <small id='zIh0j'></small><noframes id='zIh0j'>

                  <tbody id='zIh0j'></tbody>

              1. <i id='zIh0j'><tr id='zIh0j'><dt id='zIh0j'><q id='zIh0j'><span id='zIh0j'><b id='zIh0j'><form id='zIh0j'><ins id='zIh0j'></ins><ul id='zIh0j'></ul><sub id='zIh0j'></sub></form><legend id='zIh0j'></legend><bdo id='zIh0j'><pre id='zIh0j'><center id='zIh0j'></center></pre></bdo></b><th id='zIh0j'></th></span></q></dt></tr></i><div id='zIh0j'><tfoot id='zIh0j'></tfoot><dl id='zIh0j'><fieldset id='zIh0j'></fieldset></dl></div>
              2. <tfoot id='zIh0j'></tfoot>

                  <bdo id='zIh0j'></bdo><ul id='zIh0j'></ul>

                  layuitree控件没有搜索功能,在这里我们需要这个功能,要怎么操作呢?

                  1、html部分代码如下:

                  <div class="layui-col-xs2 layui-panel">
                  	<div><input type="text" id="zf_keyword"  placeholder="按关键词搜索"
                  			class="layui-input"></div>
                  	<div class="layui-tab-item layui-show" id="zf_tree"></div>
                  </div>
                  2、js代码部分如下:
                  var search = function(){
                  		$("#zf_keyword").unbind('change').change(function () {
                  		let that = this; //this;
                  		let name = $(that).val().trim();
                  		  var elem = $("#zf_tree").find('.layui-tree-txt').css('color', ''); //搜索文本与设置默认颜色
                  		  if (!name) {
                  			layer.alert("查无记录"); //无搜索值返回
                  		  }
                  		  elem.filter(':contains(' + name + ')').css('color', '#FFB800'); //搜索文本并设置标志颜色
                  		  elem.parents('.layui-tree-pack').prev().find('.layui-tree-iconClick').click(); //展开选项
                  	})
                  }
                  上一篇:利用Layui实现可编辑的表格功能 下一篇:没有了

                  相关文章

                  <tfoot id='Kq6Uv'></tfoot>

                • <small id='Kq6Uv'></small><noframes id='Kq6Uv'>

                • <legend id='Kq6Uv'><style id='Kq6Uv'><dir id='Kq6Uv'><q id='Kq6Uv'></q></dir></style></legend>

                        <bdo id='Kq6Uv'></bdo><ul id='Kq6Uv'></ul>
                    1. <i id='Kq6Uv'><tr id='Kq6Uv'><dt id='Kq6Uv'><q id='Kq6Uv'><span id='Kq6Uv'><b id='Kq6Uv'><form id='Kq6Uv'><ins id='Kq6Uv'></ins><ul id='Kq6Uv'></ul><sub id='Kq6Uv'></sub></form><legend id='Kq6Uv'></legend><bdo id='Kq6Uv'><pre id='Kq6Uv'><center id='Kq6Uv'></center></pre></bdo></b><th id='Kq6Uv'></th></span></q></dt></tr></i><div id='Kq6Uv'><tfoot id='Kq6Uv'></tfoot><dl id='Kq6Uv'><fieldset id='Kq6Uv'></fieldset></dl></div>