layer自动补全 select

layui.use(['form', 'layedit','upload'], function () { var form = layui.form form.on('select(select)', function (data) { $("#develop").val(data.value); $("#hc_select").next().find("dl").css({ "display": "none" }); form.render(); }); window.search = function () { var value = $("#develop").val(); $("#hc_select").val(value); form.render(); $("#select").next().find("dl").css({ "display": "block" }); var dl = $("#select").next().find("dl").children(); var j = -1; for (var i = 0; i < dl.length; i++) { if (dl[i].innerHTML.indexOf(value) <= -1) { dl[i].style.display = "none"; j++; } if (j == dl.length-1) { $("#elect").next().find("dl").css({ "display": "none" }); } } } }); //添加页面 @RequestMapping(value="/addUI.do") public String addUI(HttpServletRequest request){ request.setAttribute("orglist",orgService.getList()); return "/jsp/system/user/addUI.jsp"; } @Transactional(propagation = Propagation.REQUIRED, readOnly = true) public List getList(HttpServletRequest request){ String search = res.getParameter(request, "search", ""); String hql = "from _Organization order by _inputdate desc"; if(!"".equals(search)){ hql = "from _Organization where _name like '%"+ search +"%' or _name like '%"+ search +"%' order by _name,_inputdate desc"; } return (List) systemBaseDAO.findAll(hql); } public List getList(){ String hql = "from _Organization order by _inputdate desc"; return (List) systemBaseDAO.findAll(hql); }

你可能感兴趣的:(layer自动补全 select)