diff --git a/WebContent/jsp/common/property/monitoringPropertyManDetail.jsp b/WebContent/jsp/common/property/monitoringPropertyManDetail.jsp index 1a5271a..97c8820 100644 --- a/WebContent/jsp/common/property/monitoringPropertyManDetail.jsp +++ b/WebContent/jsp/common/property/monitoringPropertyManDetail.jsp @@ -306,6 +306,45 @@ var lastsel2; buttonControl(key); titleControl(key); + + // 검색 기능 + $("#btn_search").click(function() { + filterGrid(); + }); + + // 엔터키로 검색 + $("#searchText").keypress(function(e) { + if (e.which == 13) { + filterGrid(); + return false; + } + }); + + // 초기화 버튼 + $("#btn_reset").click(function() { + $("#searchText").val(""); + filterGrid(); + }); + + function filterGrid() { + var searchText = $("#searchText").val().toLowerCase(); + var grid = $("#grid"); + + // 모든 행을 순회하며 필터링 + var ids = grid.jqGrid('getDataIDs'); + for (var i = 0; i < ids.length; i++) { + var rowData = grid.jqGrid('getRowData', ids[i]); + var prptyName = (rowData.PRPTYNAME || "").toLowerCase(); + var prptyVal = (rowData.PRPTY2VAL || "").toLowerCase(); + + // 검색어가 비어있거나, 프로퍼티 키 또는 값에 포함되어 있으면 표시 + if (searchText === "" || prptyName.indexOf(searchText) >= 0 || prptyVal.indexOf(searchText) >= 0) { + $("#" + ids[i]).show(); + } else { + $("#" + ids[i]).hide(); + } + } + } }); @@ -359,10 +398,36 @@ var lastsel2; + + + +
- + + + \ No newline at end of file