Quellcode durchsuchen

资源浏览:搜索框无搜索按钮,无法进行搜索:功能实现,检索功能。

yingjie vor 9 Jahren
Ursprung
Commit
fb86680035

+ 1 - 1
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/resource/resourcebrowse/resourceJs.jsp

@ -23,7 +23,7 @@
            resource.$searchBox = $("#div_wrapper_left_inp_search").ligerSearch({
                width: 180,onClick: function (value) {
                    if (value != "" && value != null && value != undefined && value.length > 0)
                        $.ligerui.get('ul_tree1').queryByText(value);
                        $.ligerui.get('ul_tree1').queryByTextInRe(value);
                }
            });
            resource.$condition = $('#resourceCondition').ligerCondition({

+ 18 - 0
Hos-resource/src/main/webapp/develop/lib/ligerui/custom/ligerOverwrite.js

@ -587,6 +587,24 @@
                }
            }
        },
        queryByTextInRe: function (text) {
            var $g = this, p = this.options;
            //先清除颜色
            var nodeText = $("span", $g.tree);
            for (var j = 0; j < nodeText.length;j++) {
                $(nodeText[j]).removeAttr('style');
            }
            for (var i = 0; i < nodeText.length; i++) {
                if ($(nodeText[i]).text().indexOf(text) >= 0) {
                    var id = $(nodeText[i]).closest("li").attr("id");
                    $g.expandNode(id);
                    // $g.selectNode(id);
                    $(nodeText[i]).attr('style','color:#3194d5');
                }
            }
        },
        /**
         * expandNode:根据id打开节点
         * @param id