用数据岛生成翻页程序[1]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 zhangfm 的 blog

<!--张凤民-->

<html>

<head>
<title>tree walk test - jscript</title>
<style>body         { font-family: 宋体; font-size: 9pt }
.first       { color: gray; text-decoration: none }
.later       { cursor: hand; color: red; text-decoration: none }
</style>
<meta name="generator" content="microsoft frontpage 4.0">
<meta name="progid" content="frontpage.editor.document">
</head>

<!--
配置说明:width控制当前列的宽度;sortby排序指向下面的data的tagname;sorttype为排序类型,目前支持三种:text,date,number,
也可实现自己的类型,只要修改sort函数就可了
-->
<xml id="head">
<xmldata>
  <username width="150" sortby="username" sorttype="text">用户名</username>
  <pw width="150" sortby="pw" sorttype="number">密码</pw>
  <date width="200" sortby="date" sorttype="date">日期</date>
</xmldata>
</xml>
<!--
配置说明:isshow,控制此处内容是否显示;iskey是否是主键,1是且内容会在thevalue里面显示,0否;
-->
<xml id="data">
<xmldata>
<row>
  <id isshow="0" iskey="1">1</id>
  <username isshow="1" iskey="1">fmzhang1</username>
  <pw       isshow="1" iskey="1">1</pw>
  <date     isshow="1" iskey="0">2003-3-3</date>
</row>
<row>
  <id isshow="0" iskey="1">2</id>
  <username isshow="1" iskey="1">fmzhang11</username>
  <pw       isshow="1" iskey="1">1</pw>
  <date     isshow="1" iskey="0">2003-3-3</date>
</row>
<row>
  <id isshow="0" iskey="1">3</id>
  <username isshow="1" iskey="1">fmzhang2</username>
  <pw       isshow="1" iskey="1">2</pw>
  <date     isshow="1" iskey="0">2003-3-7</date>
</row>
<row>
  <id isshow="0" iskey="1">4</id>
  <username isshow="1" iskey="1">fmzhang3</username>
  <pw       isshow="1" iskey="1">3</pw>
  <date     isshow="1" iskey="0">2003-5-3</date>
</row>
<row>
  <id isshow="0" iskey="1">5</id>
  <username isshow="1" iskey="1">fmzhang4</username>
  <pw       isshow="1" iskey="1">4</pw>
  <date     isshow="1" iskey="0">2002-3-3</date>
</row>
<row>
  <id isshow="0" iskey="1">6</id>
  <username isshow="1" iskey="1">fmzhang5</username>
  <pw       isshow="1" iskey="1">5</pw>
  <date     isshow="1" iskey="0">2003-1-3</date>
</row>
<row>
  <id isshow="0" iskey="1">7</id>
  <username isshow="1" iskey="1">fmzhang6</username>
  <pw       isshow="1" iskey="1">6</pw>
  <date     isshow="1" iskey="0">2005-1-3</date>
</row>
<row>
  <id isshow="0" iskey="1">8</id>
  <username isshow="1" iskey="1">fmzhang7</username>
  <pw       isshow="1" iskey="1">7</pw>
  <date     isshow="1" iskey="0">2003-5-3</date>
</row>
<row>
  <id isshow="0" iskey="1">9</id>
  <username isshow="1" iskey="1">fmzhang8</username>
  <pw       isshow="1" iskey="1">8</pw>
  <date     isshow="1" iskey="0">2003-1-8</date>
</row>
<row>
  <id isshow="0" iskey="1">10</id>
  <username isshow="1" iskey="1">fmzhang9</username>
  <pw       isshow="1" iskey="1">9</pw>
  <date     isshow="1" iskey="0">2003-11-3</date>
</row>
</xmldata>
</xml>
<body id="objbody" onload="show('first')">

<div id="mydiv">
</div>
<table border="0" cellpadding="2" width="57%">
  <tr>
    <td width="13%"><input type="button" value="首页" onclick="show('first')"></td>
    <td width="14%"><input type="button" value="上一页" onclick="show('prov')"></td>

本文关键:数据岛 xml
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top