HTML中利用堆栈方式对Table进行行排序
来源:互联网 发布:汤浦童装淘宝店 编辑:程序博客网 时间:2024/04/29 11:21
<Html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=gb2312">
<title>HTML中利用堆栈方式对Table进行行排序</title>
<style>
body,table
{}{}{}{
font-size:9pt;
}
.grid
{}{}{}{
border:1 solid #6666FF;
width:460;
}
.grid tr
{}{}{}{
cursor:hand;
}
.grid td
{}{}{}{
border:1 solid #6666FF;
}
</style>
<script language="javascript">
<!--
function select(tr)
{
if(grid.selectedTr!=null)
{
grid.selectedTr.style.backgroundColor="";
}
grid.selectedTr=tr;
tr.style.backgroundColor="#FFCC00";
}
function isselected()
{
if(grid.selectedTr==null)
return false;
return true;
}
function push(s)
{
if(grid.stack==null)
grid.stack=[];
grid.stack.push(s);
}
function pop()
{
if(grid.stack==null)
return null;
return grid.stack.pop();
}
function movetop()
{
if(!isselected()) return;
var s=[];
s.push(grid.selectedTr.rowIndex);
s.push(0);
push(s);
grid.moveRow(grid.selectedTr.rowIndex, 0);
}
function moveup()
{
if(!isselected()) return;
var s=[];
s.push(grid.selectedTr.rowIndex);
s.push(Math.max(grid.selectedTr.rowIndex-1,0));
push(s);
grid.moveRow(grid.selectedTr.rowIndex, Math.max(grid.selectedTr.rowIndex-1,0));
}
function movedown()
{
if(!isselected()) return;
var s=[];
s.push(grid.selectedTr.rowIndex);
s.push(Math.min(grid.selectedTr.rowIndex+1,grid.rows.length-1));
push(s);
grid.moveRow(grid.selectedTr.rowIndex, Math.min(grid.selectedTr.rowIndex+1,grid.rows.length-1));
}
function movebottom()
{
if(!isselected()) return;
var s=[];
s.push(grid.selectedTr.rowIndex);
s.push(grid.rows.length-1);
push(s);
grid.moveRow(grid.selectedTr.rowIndex, grid.rows.length-1);
}
function cancelmove()
{
if(grid.stack==null || grid.stack.length==0)
return;
var s=pop();
if(s!=null)
{
select(grid.rows[s[1]]);
grid.moveRow(s[1],s[0]);
}
}
function cancelall()
{
if(grid.stack!=null && grid.stack.length>0)
{
cancelmove();
window.setTimeout(cancelall, 2000);
}
else if(grid.stack!=null)
{
alert("over!!!");
}
}
//-->
</script>
</head>
<body>
<table id="grid" class="grid">
<tr onclick="select(this);">
<td>1</td>
<td>Lonsan21@163.com</td>
<td>蓝山</td>
<td>Asp.Net</td>
<td>JS</td>
</tr>
<tr onclick="select(this);">
<td>2</td>
<td>Lonsan21@163.com</td>
<td>蓝山</td>
<td>ASP.Net</td>
<td>JS</td>
</tr>
<tr onclick="select(this);">
<td>3</td>
<td>Lonsan21@163.com</td>
<td>蓝山</td>
<td>Asp.Net</td>
<td>JS</td>
</tr>
<tr onclick="select(this);">
<td>4</td>
<td>Lonsan21@163.com</td>
<td>蓝山</td>
<td>Asp.Net</td>
<td>JS</td>
</tr>
<tr onclick="select(this);">
<td>5</td>
<td>Lonsan21@163.com</td>
<td>蓝山</td>
<td>Asp.Net</td>
<td>JS</td>
</tr>
<tr onclick="select(this);">
<td>6</td>
<td>Lonsan21@163.com</td>
<td>蓝山</td>
<td>Asp.Net</td>
<td>JS</td>
</tr>
</table>
<br>
<a href="Javascript:movetop();">Top</a>
<a href="javascript:moveup();">Up</a>
<a href="javascript:movedown();">Down</a>
<a href="javascript:movebottom();">Bottom</a>
<a href="javascript:cancelmove();">Cancel</a>
<a href="javascript:cancelall();">CancelAll</a>
</body>
</html>
- HTML中利用堆栈方式对Table进行行排序
- HTML中利用堆栈方式对Table进行行排序
- 利用堆栈方式对grid进行行排序的具体操作
- html中利用table进行布局
- 利用手头工具对html的select进行排序
- javaScript对table进行排序
- Javascript对table表格进行排序
- lua对table进行选择排序
- 利用冒泡排序对数组进行排序
- 利用快速排序对单链表进行排序
- Sql Server 中利用游标对table 的数据进行分组统计式输出…
- 利用HTMLDocument2对HTML文本进行解析
- 利用DOM对HTML元素进行操作
- 利用堆栈进行四则运算
- 利用excel对记事进行时间排序
- 利用 NSSortDescriptor 对数组进行排序
- 利用ArrayList对Hashtable其进行排序
- 利用指针对两个数字进行排序
- MATLAB程序设计教程(11)——MATLAB图形用户界面设计
- MATLAB程序设计教程(12)——SIMULINK动态仿真集成环境
- table的moveRow功能
- MATLAB程序设计教程(13)——在Word环境下使用MATLAB
- 【MSQL】标识列--“是”,“是(不用于复制)”的区别
- HTML中利用堆栈方式对Table进行行排序
- Mysql linux安装日志
- 希望自己告别过去的日子
- PR值,独立IP和PV
- CSS样式如何控制行间距
- 浅析jsp中usebean的作用域
- .NET还是JAVA,这是一个值得思考的问题
- 如何设置DropDownList的值被选中
- 在Eclipse3.2中建立可视化编程环境的步骤!