<%@ Page Language="c#" Inherits="Web.User.manageLinkGroup" CodeBehind="manageLinkGroup.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>managelinkgroup</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file="../Css/userCssList.htm"-->
    <script type="text/javascript">
        jQuery(function($) {       
            
            $("#btnSave").click(function() {
               return GridSelectCheck('newsGrid', true);
            });
            
            $("#btnDel").click(function() {
                return GridSelectCheck('newsGrid',true);
            });
            
            $("#btnAdd").click(function () {
                $.fancybox({
                    'type': 'iframe',
                    'width'		: 600,
				    'height'	: 300,
				    'hideOnOverlayClick': false,
				    'padding':'0',
				    'href'      : 'addlinkgroup.aspx?bigClassId=<%= bigClassId %>&menuId=<%= menuId %>'
				     });
				         return false;  
            }); 
            
            $(".FBox").click(function () {
                  var h = $(this).attr('disabled');
                  if (h == "disabled") {
                      $.fancybox.cancle();
                  }
              }).fancybox({
                  'width': 600,
                  'height': 300,
                  'hideOnOverlayClick': false,
                  'transitionIn': 'elastic',
                  'transitionOut': 'elastic',
                  'padding':'0',
                  'type': 'iframe'
              });
              
            /*列表高度*/
            $('.function-bd').height($(window).innerHeight() - 145);

            $(window).resize(function () {
                $('.function-bd').height($(window).innerHeight() - 145);
            });
        });
           //选中背景特效
        $(function(){
            $('.txt-c input').click(function(){
	            $(this).parents('tr').toggleClass('active');
            })
            
            $('.title.txt-c input').click(function(){
	            
	            if($('.list-table tr:first').hasClass('active')){
		            $('.list-table tr').addClass('active');
	            }else{
		            $('.list-table tr').removeClass('active');
	            }
            })
            
            $('.list-table select').change(function(){
	            //背景选中
	            if($(this).parents('tr').hasClass('active')){
		            
	            }else{
		            $(this).parents('tr').toggleClass('active');
	            }
	            
	            //复选框选中
	            var checkbox = $(this).parents("tr").find("input");
                for (var i = 0; i < checkbox.length; i++) {
                    if (checkbox[i].type == 'checkbox') {
                        checkbox[i].checked = true;
                    }
                }
                
            })
            
            //排序输入框失去焦点时选中
            $('.priority').blur(function(){
	            //背景选中
	            if($(this).parents('tr').hasClass('active')){
		            
	            }else{
		            $(this).parents('tr').toggleClass('active');
	            }
	            
	            //复选框选中
	            var checkbox = $(this).parents("tr").find("input");
                for (var i = 0; i < checkbox.length; i++) {
                    if (checkbox[i].type == 'checkbox') {
                        checkbox[i].checked = true;
                    }
                }
                
            })
        });
    
    </script>
</head>
<body>
    <div class="list-func-box func-box">
        <form id="newsMange" method="post" runat="server">
        <div class="hd">
            <div class="breadcrumb">
                <asp:PlaceHolder ID="placeHead" runat="server"></asp:PlaceHolder>
                <%-- <asp:DataList ID="menuNav" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                    <ItemTemplate>
                        <asp:Label ID="menuName" runat="server" ForeColor="white"></asp:Label>
                    </ItemTemplate>
                    <SeparatorTemplate>
                        &nbsp;&gt;&nbsp;
                    </SeparatorTemplate>
                </asp:DataList>--%>
            </div>
            <!--/breadcrumb-->
            <div class="user-service">
                <a class="help" href="#">帮助</a></div>
            <!--/user-service-->
        </div>
        <div class="bd">
            <div class="function-hd">
                <div class="search-box fr">
                </div>
                <!--/search-box-->
                <div class="action-field">
                    <asp:Button ID="btnSave" class="btn" runat="server" Text="保 存" OnClick="Btn_Click"></asp:Button>
                    &nbsp;
                    <asp:Button ID="btnAdd" class="btn" runat="server" Text="添 加"></asp:Button>
                    &nbsp;
                    <asp:Button ID="btnDel" class="btn" runat="server" Text="删 除" OnClick="Btn_Click"></asp:Button>
                </div>
                <!--/action-field-->
            </div>
            <div class="function-bd" style="height: 580px; overflow: auto;">
            <!--[if lte IE 7]><div style="zoom:1"><![endif]-->
            <asp:HiddenField ID="hfidstr" runat="server" />
            <asp:HiddenField ID="hftitlestr" runat="server" />
            <asp:DataGrid ID="newsGrid" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                class="list-table" onitemcommand="linkGroupGrid_ItemCommand">
                <Columns>
                    <asp:TemplateColumn HeaderStyle-CssClass="title txt-c" ItemStyle-CssClass="txt-c" ItemStyle-Width="36px">
                        <HeaderTemplate>
                            <asp:CheckBox ID="cbAll" Text="" runat="server" onclick="GridSelectAll('newsGrid',this.checked)" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="cbthis" runat="server" Text=""></asp:CheckBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="pkId" HeaderText="ID号" HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden" FooterStyle-CssClass="hidden">
                    </asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="grade" HeaderText="等级" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="组名称" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:Label ID="groupName" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.groupName") %>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="描述" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:Label ID="remark" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.remark")%>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="顺序" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:TextBox ID="ordering" MaxLength="6" class="input-txt priority" Style="width: 45px;" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ordering")%>'>
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="显示等级" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList Width="80" ID="gradeDrop" runat="server" DataSource="<%# dv %>" DataTextField="name" DataValueField="pkId">
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="浏览权限" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="gate" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.gate") %>'>
                                <asp:ListItem Value="0" Selected="True">无限制</asp:ListItem>
                                <asp:ListItem Value="1">仅内网可见</asp:ListItem>
                                <asp:ListItem Value="2">仅登录可见</asp:ListItem>
                                <asp:ListItem Value="3">内网或登录可见</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="是否显示" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="isShowDropDownList" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.isShow") %>'>
                                <asp:ListItem Value="0">不显示</asp:ListItem>
                                <asp:ListItem Value="1">显示</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="排序" HeaderStyle-CssClass="title" Visible="false">
                        <ItemTemplate>
                            <asp:TextBox ID="Priority" runat="server" MaxLength="6" Text='<%#Eval("Priority")%>' class="input-txt" Style="width: 45px;"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="管理" HeaderStyle-CssClass="title" ItemStyle-CssClass="td-a">
                        <ItemTemplate>
                             <asp:HyperLink ID="edit" runat="server"  CssClass="FBox">编辑</asp:HyperLink>
                            &nbsp;
                            <asp:LinkButton ID="linkGangsLinkButton" runat="server" CommandName="editLinkGang">链接项管理</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn Visible="False" DataField="grade" HeaderText="等级" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                </Columns>
            </asp:DataGrid>
            <!--[if lte IE 7]></div><![endif]-->
            </div>
        </div>
        <div class="ft">
            <div class="pagination">
                <asp:Label ID="showPage" runat="server"></asp:Label>
            </div>
        </div>
        </form>
    </div>
</body>
</html>
