以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [原创]wb框架手机数据分页错位问题? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=131755) |
-- 作者:yjm789000 -- 发布时间:2019/3/6 0:39:00 -- [原创]wb框架手机数据分页错位问题? 因为我使用的不是sql server数据库,所以帮助文档中的数据分页显示案例中的 Select Row_Number() 无法使用,因此根据最原始的入门里面的分页显示,进行wb框架的使用,出现错位问题,请求老师帮忙解决下? 出现问题的代码为下面标红加粗的地方: Dim e As RequestEventArgs = Args(0) Dim wb As New WeUI Dim page As Integer = 0 \'默认page为0,显示第一页 Dim pageRows As Integer = 15 \'每页10行 If e.GetValues.ContainsKey("page") Then \'如果地址中有page参数 Integer.TryParse(e.GetValues("page"), page) \'提取page参数 End If Dim StartRow As Integer = page * pageRows \'此页第一行 Dim EndRow As Integer = (page + 1) * pageRows-1 \'此页最后一行 Dim lst As List(of DataRow) = DataTables("村数据表").Select("","") \'按日期顺序显示 If StartRow > lst.Count -1 Then e.WriteString("已经是最后一页!") Return"" End If EndRow = Math.Min(EndRow, lst.Count - 1) \'这是必须的 With wb.AddTable("","Table1") .Alternate = 3 Dim nms() As String = {"县级名称","乡镇名称","行政村名","备注"} .Head.AddRow(nms) For r As Integer = StartRow To EndRow For Each nm As String In nms With .Body.AddRow( lst(r)(nm)) End With Next Next End With With wb.AddButtonGroup("","btg2", False) If page > 0 Then .Add("btnPrev", "上一页","","List.htm?page=" & page - 1) End If If Endrow < lst.Count -1 Then .Add("btnNext", "下一页","","List.htm?page=" & page + 1) End If End With e.WriteString(wb.Build) |
-- 作者:有点甜 -- 发布时间:2019/3/6 8:55:00 -- access数据库,参考
http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=125380&skin=0
|