CardSearchForm.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : CardSearchForm.html
  7. * @desc : 카드 리스트 팝업
  8. *============================================================================
  9. * STYLE24
  10. * Copyright(C) 2020 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2021.09.28 swkim 최초 작성
  15. *******************************************************************************
  16. -->
  17. <div class="modalPopup" data-width="500" id="popupCardList">
  18. <div class="panelStyle">
  19. <!-- TITLE -->
  20. <div class="panelTitle">
  21. <strong>카드 목록</strong>
  22. <button type="button" class="close" onclick="uifnPopupClose('popupCardList');"><em class="fa fa-times"></em></button>
  23. </div>
  24. <!-- //TITLE -->
  25. <!-- 검색 조건 -->
  26. <div class="panelContent">
  27. <form id="searchCardListForm" class="searchCardListForm" name="searchCardListForm" action="#" th:action="@{'/statistics/card/list'}" onsubmit="$('#btnSearchCardList').trigger('click'); return false;">
  28. <table class="frmStyle" aria-describedby="검색조건">
  29. <colgroup>
  30. <col style="width:15%;"/>
  31. <col/>
  32. </colgroup>
  33. <tbody>
  34. </table>
  35. <!--<ul class="panelBar">
  36. <li class="center">
  37. <button type="button" class="btn btn-base btn-lg" id="btnSearchCardList">조회</button>
  38. </li>
  39. </ul>-->
  40. </form>
  41. </div>
  42. <!-- //검색 조건 -->
  43. <!-- 리스트 영역 -->
  44. <div class="panelContent">
  45. <div id="gridCardPopupList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
  46. </div>
  47. <!-- //리스트 영역 -->
  48. <!-- 버튼 배치 영역 -->
  49. <ul class="panelBar">
  50. <li class="right">
  51. <button type="button" class="btn btn-info btn-lg" id="btnConfirmCard">확인</button>
  52. </li>
  53. </ul>
  54. </div>
  55. <script th:inline="javascript">
  56. /*<![CDATA[*/
  57. let columnCardPopupDefList = [
  58. {width: 40, minWidth: 40, field: "cardCheck", cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
  59. {headerName: "카드명", field: "cardNm", width: 400, cellClass: 'text-center'}
  60. ];
  61. let gridOptionsCardPopupList = gagaAgGrid.getGridOptions(columnCardPopupDefList);
  62. gridOptionsCardPopupList.rowSelection = "multiple";
  63. // Row double click
  64. gridOptionsCardPopupList.onRowDoubleClicked = function(event) {
  65. $('#btnConfirmCard').trigger('click');
  66. }
  67. // 조회
  68. /*$('#btnSearchCardList').on('click', function() {
  69. // Fetch data
  70. gagaAgGrid.fetch($('#searchCardListForm').prop('action'), gridOptionsCardPopupList, '#searchCardListForm', function() {
  71. gridOptionsCardPopupList.api.forEachNode(function(rowNode, index) {
  72. });
  73. });
  74. });*/
  75. // 확인
  76. $('#btnConfirmCard').on('click', function() {
  77. var selectedData = gagaAgGrid.selectedRowData(gridOptionsCardPopupList);
  78. if (selectedData.length == 0) {
  79. mcxDialog.alert('선택된 카드가 없습니다.');
  80. return false;
  81. }
  82. var callbackFn = [[${params.callbackFn}]];
  83. var jsonData = JSON.stringify(selectedData);
  84. if (typeof callbackFn != 'undefined' && callbackFn) {
  85. if (typeof callbackFn == 'function') {
  86. callbackFn(jsonData);
  87. } else {
  88. if (callbackFn) {
  89. if (callbackFn.indexOf("(") == -1) {
  90. eval(callbackFn + "(" + jsonData + ")");
  91. } else {
  92. eval(callbackFn(jsonData));
  93. }
  94. }
  95. }
  96. uifnPopupClose('popupCardList');
  97. }
  98. });
  99. $(document).ready(function() {
  100. // Create a agGrid
  101. gagaAgGrid.createGrid('gridCardPopupList', gridOptionsCardPopupList);
  102. // Fetch data
  103. gagaAgGrid.fetch($('#searchCardListForm').prop('action'), gridOptionsCardPopupList, '#searchCardListForm', function() {
  104. gridOptionsCardPopupList.api.forEachNode(function(rowNode, index) {
  105. });
  106. });
  107. });
  108. /*]]>*/
  109. </script>
  110. </div>
  111. </html>