<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/jsp/common/include/localemessage.jsp" %>
<%@ page import="com.eactive.eai.rms.common.login.SessionManager"%>
<%@ page import="com.eactive.eai.common.util.SystemUtil"%>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setHeader("Expires", "0");
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="/jsp/common/include/css.jsp"/>
<jsp:include page="/jsp/common/include/script.jsp"/>
<script>

var url      = '<c:url value="/onl/admin/service/eaiMsgEasyDelete.json" />';
var url_view = '<c:url value="/onl/admin/service/eaiMsgEasyDelete.view" />';

$(document).ready(function() {
	
	var gridPostData = getSearchForJqgrid("cmd","LIST"); //jqgrid에서는 object 로
	
	$('#grid').jqGrid({
		datatype:"json",
		mtype: 'POST',
		url: url,
		postData : gridPostData,
		colNames:['IF 서비스명',
                  'IF 서비스설명',
                  'IF서비스키',
                  'B2BEXT 라우팅',
                  '복원 메세지 키',
                  '요청변환',
                  '응답변환',
                  '에러변환'
                  ],
		colModel:[
				{ name : 'HE01_EAISVCNAME'     			, align:'left', width:60 },
				{ name : 'HE01_EAISVCDESC'				, align:'left' },
				{ name : 'HS04_BZWKSVCKEYNAME'       	, align:'left', width:40 },
				{ name : 'FR06_SVCROUTCLSNAME'			, align:'left', width:40 },
				{ name : 'FR03_BZWKFLDNAME'				, align:'left', width:40 },
				{ name : 'HE02_CHNGMSGIDNAME' 			, align:'left', width:100 },
				{ name : 'HE02_BASCRSPNSCHNGMSGIDNAME' 	, align:'left', width:100 },
				{ name : 'HE02_ERRRSPNSCHNGMSGIDNAME'	, align:'left', width:100 }
				],
        jsonReader: {
             repeatitems:false
        },
		pager : $('#pager'),
		page : '${param.page}',
		rowNum : '${rmsDefaultRowNum}',
	    autoheight: true,
	    height: $("#container").height(),
		autowidth: true,
		viewrecords: true,
		multiboxonly: false,
		rowList : eval('[${rmsDefaultRowList}]'),
		gridComplete:function (d){
			var colModel = $(this).getGridParam("colModel");
			for(var i = 0 ; i< colModel.length; i++){
				$(this).setColProp(colModel[i].name, {sortable : false});	//그리드 헤더 화살표 삭제(정렬X)		
			}
		},			
		loadComplete:function (d){
			
		},
        loadError: function (jqXHR, textStatus, errorThrown) {
        	
        	var location ='<%=request.getContextPath()%>/';
        	comloadError(jqXHR, textStatus, errorThrown ,location);
        	
    	},		
		ondblClickRow: function(rowId) {
			
			var rowData = $(this).getRowData(rowId); 
            var url2 = url_view;
            
            url2 += '?cmd=DETAIL';
            url2 += '&page='+$(this).getGridParam("page");
            url2 += '&returnUrl='+getReturnUrl();
            url2 += '&menuId='+'${param.menuId}';
        	url2 += '&sortName='+$("#grid").getGridParam("sortname");
        	url2 += '&sortOrder='+$("#grid").getGridParam("sortorder");            
			//검색값
            url2 += '&'+getSearchUrl();
            
            //key값
            url2 += '&eaiSvcName=' + rowData['HE01_EAISVCNAME'];
            url2 += '&eaiSvcDesc=' + rowData['HE01_EAISVCDESC'];
            url2 += '&bzwkSvcKeyName=' + rowData['HS04_BZWKSVCKEYNAME'];
            url2 += '&svcRoutClsName=' + rowData['FR06_SVCROUTCLSNAME'];
            url2 += '&bzwkFldName=' + rowData['FR03_BZWKFLDNAME'];
            url2 += '&trans_chngMsgIdName=' + rowData['HE02_CHNGMSGIDNAME'];
            url2 += '&trans_bascRspnsChngMsgIdName=' + rowData['HE02_BASCRSPNSCHNGMSGIDNAME'];
            url2 += '&trans_errRspnsChngMsgIdName=' + rowData['HE02_ERRRSPNSCHNGMSGIDNAME'];
            
            goNav(url2);
			
        }
	});
	
	$("#btn_search").click(function() {
		var gridPostData = getSearchForJqgrid("cmd","LIST");
		$("#grid").setGridParam({ url:url, postData: gridPostData, page:"1"}).trigger("reloadGrid");
	});
	
	$("input[name^=search]").keydown(function(key) {
		if (key.keyCode == 13) {
			$("#btn_search").click();
		}
	});
	
	buttonControl();
	
});
</script>
</head>
<body>

	<!-- Main Page Content -->
	
	<div class="right_box">
		<div class="content_top">
			<ul class="path">
				<li><a href="#">${rmsMenuPath}</a></li>					
			</ul>					
		</div><!-- end content_top -->
		<div class="content_middle" id="content_middle">
			<div class="search_wrap">
				<img src="<c:url value="/img/btn_search.png"/>" alt="" id="btn_search" level="R" />
			</div>
			<div class="title">인터페이스 간편삭제</div>
			<form id="ajaxForm">
				<table class="search_condition" cellspacing=0;>
					<tbody>
						<tr>
							<th style="width:180px;"><%= localeMessage.getString("eaiMessage.eaiSvcName")%></th>
							<td>
								<input type="text" name="searchEaiSvcName" value="${param.searchEaiSvcName}">
							</td>	
							<th style="width:180px;"><%= localeMessage.getString("eaiMessage.eaiSvcDesc")%></th>
							<td>
								<input type="text" name="searchEaiSvcDesc" value="${param.searchEaiSvcDesc}">
							</td>
						</tr>	
					</tbody>
				</table>
			</form>
			<table id="grid"></table>
			<div id="pager"></div>
		</div>
	</div>
	
	<!-- Main Page Content End -->
	
</body>
</html>