<!DOCTYPE html>
<html lang="ko"
	xmlns:th="http://www.thymeleaf.org">
<!--
 *******************************************************************************
 * @source  : DeliveryDetailItemForm.html
 * @desc    : 배송정보이력
 *============================================================================
 * ISTYLE24
 * Copyright(C) 2021 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE         AUTHOR      DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2021.06.17   jsh77b       최초 작성
 *******************************************************************************
 -->


<div class="modalPopup" data-width="750" >
	<div class="panelStyle">
		<div class="panelTitle">
			<h2>배송정보이력</h2>
			<button type="button" class="close" onclick="uifnPopupClose('popupSweetTrackerDeliveryInfo')"><i class="fa fa-times"></i></button>
		</div>
				
		<div class="panelContent" style="overflow-y:auto;">
			<form id="DeliveryDetailItemFrm">
				<div id="gridDelvDetailItemInfo" style="width:100%; height: 260px;" class="ag-theme-balham"></div>
			</form>
		</div>
	</div>
</div>

<script th:inline="javascript">
/*<![CDATA[*/

var sweetTrackerDeliveryList = [[${sweetTrackerDeliveryList}]];

// specify the columns
var columnDefsDelvDetailItemInfo = [
		{headerName: "택배사처리시간"	, field: "timeTrans"	, width: 150	, cellClass: 'text-center'},
		{headerName: "택배위치"		, field: "delvWhere"	, width: 160	, cellClass: 'text-left'},
		{headerName: "배송상세정보"	, field: "details"		, width: 240	, cellClass: 'text-left'},
		{
			headerName		: "연락처"
			, field			: "telno"
			, width			: 130
			, cellClass		: 'text-center'
			, cellRenderer	: function (params) {
				var retStr = '';
				
				if (!gagajf.isNull(params.value)) {
					retStr = params.value.replace(/[^0-9]/g, "").replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3").replace("--", "-");
				}
				return retStr;
			}
		}
];

$(document).ready(function() {
	// Get GridOptions
	var gridDelvDetailItemInfo = gagaAgGrid.getGridOptions(columnDefsDelvDetailItemInfo);
	gagaAgGrid.createGrid('gridDelvDetailItemInfo', gridDelvDetailItemInfo);
	gridDelvDetailItemInfo.api.setRowData(sweetTrackerDeliveryList);
	$('.ag-status-bar').hide();
});
	
//2021.04.09 하이픈처리
$(document).on("keyup", "#deliveryModifyForm input[name=recipPhnno]", function() { 
	$(this).val( $(this).val().replace(/[^0-9]/g, "").replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3").replace("--", "-") ); 
});
	
/*]]>*/
</script>

</html>
