62,074
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Title="" Language="C#" MasterPageFile="~/JifenMall/QueryMode.Master" AutoEventWireup="true"
CodeBehind="AvayaPhone.aspx.cs" Inherits="jifenmaneger.JifenMall.AvayaPhone" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
function serchPhone_onclick() {
}
</script>
<script type="text/javascript" src="../JS/superTables.js"></script>
<link href="../Styles/superTables_Default.css" rel="Stylesheet" type="text/css" />
<style type="text/css">
.gridcell{ padding:5px;}
.fakeContainer {
float:right;
margin: 5px;
border: solid 1px #ccc;
width: 900px;
height: 600px;
background-color: #ffffff;
overflow: hidden;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="QueryContent" runat="server">
<table cellpadding="0" cellspacing="0" style="text-align:center; margin:40px;" >
<tr>
<td style="padding-left:50px;">
<label>姓名: </label><asp:TextBox ID="serchName" runat="server"></asp:TextBox>
</td>
<td style="padding-left:50px;">
<label>城市: </label><asp:TextBox ID="serchCity" runat="server"></asp:TextBox>
</td>
<td style="padding-left:50px;">
<asp:ImageButton runat="server" ID="serchPhone"
ImageUrl="../Images/%E6%90%9C%E7%B4%A2.gif" onclick="serchPhone_Click" />
</td>
</tr>
</table>
<div id="ta">
<asp:GridView ID="avayatel" runat="server" CellPadding="3" Font-Size="12pt" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" >
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" Wrap="False" CssClass="gridcell" />
<RowStyle ForeColor="#000066" />
</asp:GridView>
</div>
<script type="text/javascript">
var grid = document.getElementById("avayatel");
alert(grid);
if (grid != null && grid != undefined) {
grid.parentNode.className = "fakeContainer";
(function () {
var start = new Date();
superTable("avayatel", {
cssSkin: "Default",
// fixedColsdd 设置要固定的列数,这里设置固定3列
fixedCols: 3,
onFinish: function () {
// Basic row selecting for a superTable with/without fixed columns
if (this.fixedCols == 0) {
for (var i = 0, j = this.sDataTable.tBodies[0].rows.length; i < j; i++) {
this.sDataTable.tBodies[0].rows[i].onclick = function (i) {
var clicked = false;
var dataRow = this.sDataTable.tBodies[0].rows[i];
return function () {
if (clicked) {
dataRow.style.backgroundColor = "#ffffff";
clicked = false;
}
else {
dataRow.style.backgroundColor = "#eeeeee";
clicked = true;
}
}
} .call(this, i);
}
}
else {
for (var i = 0, j = this.sDataTable.tBodies[0].rows.length; i < j; i++) {
//xugang begin
if (i % 2 == 0) {
this.sDataTable.tBodies[0].rows[i].style.backgroundColor = "#f5ffef";
}
if (i >= (j - 2)) {
this.sDataTable.tBodies[0].rows[i].style.backgroundColor = "#eeeeee"; //"#ffffd2";
}
//xugang end
this.sDataTable.tBodies[0].rows[i].onclick = this.sFDataTable.tBodies[0].rows[i].onclick = function (i) {
var clicked = false;
var dataRow = this.sDataTable.tBodies[0].rows[i];
var fixedRow = this.sFDataTable.tBodies[0].rows[i];
var dataRow_old_Color = dataRow.style.backgroundColor;
var fixedRow_old_Color = fixedRow.style.backgroundColor;
return function () {
if (clicked) {
dataRow.style.backgroundColor = fixedRow_old_Color; //"#ffffff";
fixedRow.style.backgroundColor = fixedRow_old_Color; //"#eeeeee";
clicked = false;
}
else {
dataRow.style.backgroundColor = "#ffffd2";
fixedRow.style.backgroundColor = "#adadad";
clicked = true;
}
}
} .call(this, i);
}
}
return this;
}
});
})();
}
</script>
</asp:Content>
//如果这样还是null的话 说明你的grid没数据 没数据的话 页面上是不生成元素的
var grid = document.getElementById("<%=avayatel.ClientID%>");