一个类似Listview的效果
2014-04-19 15:27
246 查看
一个类似Listview的效果
<title>列表</title>
<style>
<!--
body { font-size: 10px }
table { font-size: 12px }
-->
</style>
<script language = 'javascript'>
function InitList(theList, theTable, iEnd, iId, checkIt)
{
var colWidth = (document.body.clientWidth - 200) / iEnd
with(theList)
{
View = 3
BorderStyle = 0
GridLines = true
Checkboxes = checkIt
FullRowSelect = true
LabelEdit = 1
for(var i = 0; i < iEnd; i ++)
{
ColumnHeaders.Add(i + 1, 'Col' + i, theTable.rows[0].cells[i].innerText, colWidth) //, 100, myAlign)
}
for(var i = 1; i < theTable.rows.length; i ++)
{
myList.ListItems.Add( i, 'Key' + theTable.rows[i].cells[iId -1].innerText.replace(" ", ""), theTable.rows[i].cells[0].innerText.replace(" ", ""))
for(var j = 1; j < iEnd; j ++)
{
ListItems(i).SubItems(j) = theTable.rows[i].cells[j].innerText.replace(" ", "")
}
}
Sorted = true
}
}
</script>
<script language = 'javascript' for = 'myList' event = 'ColumnClick(ColumnHeader)'>
if(ColumnHeader.SubItemIndex == myList.SortKey)
{
if(myList.SortOrder == 0) myList.SortOrder = 1
else myList.SortOrder = 0
}
else
{
myList.SortKey = ColumnHeader.SubItemIndex
if(myList.SortOrder == 0) myList.SortOrder = 1
else myList.SortOrder == 0
}
</script>
<script language = 'javascript' for = 'myList' event = 'ItemClick(Item)'>
var theValue = ""
theValue = Item.Text + Item.Key
for(i = 1; i <= Item.ListSubItems.Count; i ++) theValue = theValue + "\n" + Item.ListSubItems(i).Text
myValue.value = theValue
</script>
<body onload = 'InitList(myList, myTale, 4, 5, false)' scroll = 'no' bgcolor = 'buttonface' topmargin='0' leftmargin='0'>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%' height='100%'>
<tr>
<td nowrap>
<script language = 'javascript'>
document.write( "<object classid='clsid:BDD1F04B-858B-11D1-B16A-00C0F0283628' style = 'width:" + (document.body.clientWidth - 150) + ";height:" + document.body.clientHeight + "' id='myList'></object> ")
</script>
<table border = '1' id = 'myTale' style = 'display:none'>
<tr id = 'tablehead'>
<td id = 'mytd'>
编号
</td>
<td id = 'mytd'>
名称
</td>
<td id = 'mytd'>
价格
</td>
<td id = 'mytd'>
备注
</td>
<td id = 'mytd'>
编号
</td>
</tr>
<tr id = 'mytr'>
<td id = 'mytd'>
101
</td>
<td id = 'mytd'>
53度特酿
</td>
<td id = 'mytd'>
186
</td>
<td id = 'mytd'>
1*6
</td>
<td id = 'mytd'>
16
</td>
</tr>
<tr id = 'mytr'>
<td id = 'mytd'>
102
</td>
<td id = 'mytd'>
52趵突泉特酿
</td>
<td id = 'mytd'>
128
</td>
<td id = 'mytd'>
1*6
</td>
<td id = 'mytd'>
17
</td>
</tr>
<tr id = 'mytr'>
<td id = 'mytd'>
103
</td>
<td id = 'mytd'>
39度精品趵突泉特酿
</td>
<td id = 'mytd'>
60
</td>
<td id = 'mytd'>
1*6
</td>
<td id = 'mytd'>
18
</td>
</tr>
<tr id = 'mytr'>
<td id = 'mytd'>
104
</td>
<td id = 'mytd'>
34度趵突泉特酿
</td>
<td id = 'mytd'>
45.8
</td>
<td id = 'mytd'>
1*6
</td>
<td id = 'mytd'>
19
</td>
</tr>
<title>列表</title>
<style>
<!--
body { font-size: 10px }
table { font-size: 12px }
-->
</style>
<script language = 'javascript'>
function InitList(theList, theTable, iEnd, iId, checkIt)
{
var colWidth = (document.body.clientWidth - 200) / iEnd
with(theList)
{
View = 3
BorderStyle = 0
GridLines = true
Checkboxes = checkIt
FullRowSelect = true
LabelEdit = 1
for(var i = 0; i < iEnd; i ++)
{
ColumnHeaders.Add(i + 1, 'Col' + i, theTable.rows[0].cells[i].innerText, colWidth) //, 100, myAlign)
}
for(var i = 1; i < theTable.rows.length; i ++)
{
myList.ListItems.Add( i, 'Key' + theTable.rows[i].cells[iId -1].innerText.replace(" ", ""), theTable.rows[i].cells[0].innerText.replace(" ", ""))
for(var j = 1; j < iEnd; j ++)
{
ListItems(i).SubItems(j) = theTable.rows[i].cells[j].innerText.replace(" ", "")
}
}
Sorted = true
}
}
</script>
<script language = 'javascript' for = 'myList' event = 'ColumnClick(ColumnHeader)'>
if(ColumnHeader.SubItemIndex == myList.SortKey)
{
if(myList.SortOrder == 0) myList.SortOrder = 1
else myList.SortOrder = 0
}
else
{
myList.SortKey = ColumnHeader.SubItemIndex
if(myList.SortOrder == 0) myList.SortOrder = 1
else myList.SortOrder == 0
}
</script>
<script language = 'javascript' for = 'myList' event = 'ItemClick(Item)'>
var theValue = ""
theValue = Item.Text + Item.Key
for(i = 1; i <= Item.ListSubItems.Count; i ++) theValue = theValue + "\n" + Item.ListSubItems(i).Text
myValue.value = theValue
</script>
<body onload = 'InitList(myList, myTale, 4, 5, false)' scroll = 'no' bgcolor = 'buttonface' topmargin='0' leftmargin='0'>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%' height='100%'>
<tr>
<td nowrap>
<script language = 'javascript'>
document.write( "<object classid='clsid:BDD1F04B-858B-11D1-B16A-00C0F0283628' style = 'width:" + (document.body.clientWidth - 150) + ";height:" + document.body.clientHeight + "' id='myList'></object> ")
</script>
<table border = '1' id = 'myTale' style = 'display:none'>
<tr id = 'tablehead'>
<td id = 'mytd'>
编号
</td>
<td id = 'mytd'>
名称
</td>
<td id = 'mytd'>
价格
</td>
<td id = 'mytd'>
备注
</td>
<td id = 'mytd'>
编号
</td>
</tr>
<tr id = 'mytr'>
<td id = 'mytd'>
101
</td>
<td id = 'mytd'>
53度特酿
</td>
<td id = 'mytd'>
186
</td>
<td id = 'mytd'>
1*6
</td>
<td id = 'mytd'>
16
</td>
</tr>
<tr id = 'mytr'>
<td id = 'mytd'>
102
</td>
<td id = 'mytd'>
52趵突泉特酿
</td>
<td id = 'mytd'>
128
</td>
<td id = 'mytd'>
1*6
</td>
<td id = 'mytd'>
17
</td>
</tr>
<tr id = 'mytr'>
<td id = 'mytd'>
103
</td>
<td id = 'mytd'>
39度精品趵突泉特酿
</td>
<td id = 'mytd'>
60
</td>
<td id = 'mytd'>
1*6
</td>
<td id = 'mytd'>
18
</td>
</tr>
<tr id = 'mytr'>
<td id = 'mytd'>
104
</td>
<td id = 'mytd'>
34度趵突泉特酿
</td>
<td id = 'mytd'>
45.8
</td>
<td id = 'mytd'>
1*6
</td>
<td id = 'mytd'>
19
</td>
</tr>
相关文章推荐
- 一个类似Listview的效果
- Android上一个类似PathMenu效果的自定义View源码分析
- Android-->改造Xlistview完成自动下拉刷新(类似网易)效果
- [ViewPager、一]ViewPager和PagerAdapter做动态加载页(类似listView适配根据data新增的效果)
- 利用RecycleView实现类似ListView的Item点击,长按等操作事件以及点击后每一项在添加一个列表
- silverlight使用DataGrid实现类似Treelistview效果
- 又一个类似TIPS效果,很pl的,看截图吧
- 如何实现当一个应用调用另一个应用的某个activity的时候,让这个activity类似dialog的效果,但是这个应用单独运行的时候还是铺满屏幕的效果
- 一个类似fork炸弹的效果
- 写了一个类似QQ的item侧滑效果,以待后用
- Android开发之-类似iPhone弹性效果的BounceListView
- 【Unity快速实现小功能】实现一个类似跑马灯的效果
- 一个可以实现 左右联动JTable 的完全Dialog 实现类似 Excel的冻结第一列 效果
- Android开发之-类似iPhone弹性效果的BounceListView
- android类似微信朋友圈评论效果,listview定位,item总在输入法上面的位置
- 今天上qq空间看到一个有意思的东西,类似射线的效果
- 类似app常见效果,弹出一个提示语句(黑色背景+白色文字),2s后消失(来自改编alert,在h5里比较实用的),下面附上效果图
- ANDROID开发之-类似IPHONE弹性效果的BOUNCELISTVIEW
- 一个js下拉菜单 类似jq效果
- 发一个类似alertView 弹出来的 动画效果代码片段