<%@ Page language="c#"%>
<%@ Register assembly="XpShopGrid" namespace="XpShopGrid" tagprefix="XpShopGrid" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<head runat="server">
    <meta http-equiv="content-type" content='text/html;charset=utf-8'/>
    <title>GridTest1</title> 
    <link rel="stylesheet" href="style/main.css" type="text/css"/>
    <link href="inc/jqgrid/css/jquery-ui-1.7.1.custom.css" rel="stylesheet" type="text/css" />   
    <link href="inc/jqgrid/css/ui.jqgrid.hack.css" rel="stylesheet" type="text/css" /> 
    <link href="inc/jqgrid/css/ui.jqgrid.css" rel="stylesheet" type="text/css" />
    <link href="inc/jqgrid/css/ui.multiselect.css" rel="stylesheet" type="text/css" />
    <link href="inc/popup/jquery.popup.css" rel="stylesheet" type="text/css" />
    <script src="inc/jqgrid/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="inc/jqgrid/grid.locale-cn.js" type="text/javascript"></script>        
    <script src="inc/jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script>
    <script src="inc/jqgrid/grid.common.extend.js" type="text/javascript"></script>
    <script src="inc/jqgrid/grid.formedit.extend.js" type="text/javascript"></script>
    <script src="inc/popup/jquery.popup.js" type="text/javascript"></script>
    <script src="inc/commond.js" type="text/javascript"></script>
    <script language="javascript" src="../inc/overlib.js"></script>
     <script type="text/javascript">
		function GridComplete()
		{
			var ids = $('#XpShopGrid1Table').getDataIDs();
			for(var i=0;i<ids.length;i++){
				//var cl = ids[i];
				//var logo = "<a href=\"#\" onmouseover=\"return overlib(&quot;<IMG SRC=../Upload/BrandLogo/Logo_090611052754北美.gif>&quot;, CAPTION, &quot;ACA&quot;,FGCOLOR, '#fcfcfc', BGCOLOR, '#0080C0', CAPCOLOR, '#ffffff', BORDER, 2, CLOSETEXT, 'Close');\" onmouseout=\"nd();\"><img src=\"images/icon-viewpic.gif\" border=\"0\"></a>";
				var logo = "<img src=\"../Upload/BrandLogo/" + $('#XpShopGrid1Table').jqGrid('getCell',ids[i],'Logo') + "\" width=\"80\" height=\"60\"/>";
				jQuery('#XpShopGrid1Table').jqGrid('setRowData',ids[i],{Logo:logo});
				//bj = "<input class='btnEdit' type='button' value='编辑' onclick=\"$.fn.popup({iframe:true,url:'brand.aspx?action=Modify&BrandID=" + ids[i] + "',title:'品牌修改',type:8,width:$(window).width(),height:$(window).height()},function(){alert('ddddd')});\"  />"; 
				//bj = "<input class='btnEdit' type='button' value='编辑' onclick=\"preview('brand.aspx?action=Modify&BrandID=" + ids[i] + "');\"  />";
				bj = "<input class='btnEdit' type='button' value='编辑' onclick=\"jQuery('#XpShopGrid1Table').jqGrid('editGridRow1','"+ids[i]+"',{editCaption:'修改品牌',bSubmit:'保存',url:'brand.aspx?nocopyright=1&action=Modify&BrandID='});\"  />";  
				//bj = "<input class='btnEdit' type='button' value='编辑' onclick=\"editFunc('" +ids[i] +"','brand.aspx?nocopyright=1&action=Modify&BrandID=')\"  />";  
                jQuery("#XpShopGrid1Table").jqGrid('setRowData',ids[i],{act:bj});
			};
		}
		function preview(site)
		{
			$(document.body).popup($.extend({
				buttons: {
					取消关闭: function(){
						//alert('close');
					},
					提交保存: function(){               
						$('#btnSave',$('#popup_iframe1')[0].contentWindow.document).click();
						$("#XpShopGrid1Table").trigger("reloadGrid"); 
					}
				},
				iframe: true,
				//scrolling:'none',
				type: 9,
				url:site,
				title:'品牌修改',
				width: $(window).width(),
				height: $(window).height()
			}));
		}
		var editFunc = function(rowid){
			jQuery('#XpShopGrid1Table').jqGrid('editGridRow1',rowid,{editCaption:'修改品牌',bSubmit:'保存',url:'brand.aspx?nocopyright=1&action=Modify&BrandID='});
		};
		var addFunc = function(){
			$('#XpShopGrid1Table').jqGrid('editGridRow1','new',{addCaption:'添加品牌',url:'brand.aspx?nocopyright=1&action=Add'});
		};
        $(document).ready(function(){
            ph = $(window.parent.frames.right).height()-$('div.sub_container_title').height()-$('div.sub_container_operation').height()-30-30;
        });
     </script>
</head>
<body>
	<div class="container">
		<div class="sub_container">
			<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />品牌列表</div>
			<div class="sub_container_content">
				<XpShopGrid:XpShopGrid ID="XpShopGrid1" runat="server" TableName="Brand" Sortname="BrandID" Search="true" Add="true" Edit="true" Del="true" RowNum="30" Multiselect="true" AutoWidth="true" />
				<div id="overDiv" style="Z-INDEX: 1000; VISIBILITY: hidden; POSITION: absolute"></div>
			</div>
		</div>
	</div>
</body>
</HTML>
