老师
现在做一个企业号的查询. 我是用TabBar 分开两个page,想实现到了page 底部可以更新数据 ,代码如下:
Dim ddzb As DataTable
Dim wb As New WeUI
wb.Title = "销售订单查询"
cmd.CommandText = sql 语句
ddzb = cmd.ExecuteReader()
If ddzb.datarows.Count > 0 Then
With wb.AddTabBar("", "tb1", 1)
.AddPage("page1","销售订单明细")
.AddPage("page2","销售订单条件")
End With
With wb.AddPanelGroup("page1","pg2","订单明细列表")
For Each pr As DataRow In ddzb.datarows
Dim pt As String = "客户名称:" & pr("客户名称") &""
Dim txt As String = "编号: " & pr("_Identify") & ";日期:" & pr("送货日期") & ";业务:" & pr("业务员") & ";方式:" & pr("送货方式") & ""
Next
End With
wb.AppendHTML("<script src='/hito/ssdd.js'></script>") '引入脚本文件
wb.AppendHTML("<script>window.</script>")
e.WriteString(wb.Build)
End If
Js 代码如下:
//获取滚动条当前的位置
function getScrollTop() {
var scrollTop = 0;
if (document.documentElement && document.documentElement.scrollTop) {
scrollTop = document.documentElement.scrollTop;
}
else if (document.body) {
scrollTop = document.body.scrollTop;
}
return scrollTop;
}
//获取当前可是范围的高度
function getClientHeight() {
var clientHeight = 0;
if (document.body.clientHeight && document.documentElement.clientHeight) {
clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight);
}
else {
clientHeight = Math.max(document.body.clientHeight, document.documentElement.clientHeight);
}
return clientHeight;
}
//获取文档完整的高度
function getScrollHeight() {
return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
}
function scr() {
If (getScrollTop() + getClientHeight() == getScrollHeight()) {
alert("到达底部");
}
}