以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 分码加载页数没有自动更新 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=111148) |
-- 作者:aza520 -- 发布时间:2017/12/15 21:49:00 -- 分码加载页数没有自动更新 分码加载时文本框控件内的页数没有自动更新。帮助示例中是外部表,我的是内部表,所以有点不知道怎么套用代码。请老师指点一下 窗口AfterLoad代码: Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") trv.BuildTree("S征地记录", "项目名称|县|乡|村|屯|组") trv.Nodes.Insert("显示所有行",0) 加载树NodeMouseDoubleClick代码: Dim Filter As String = "1=1" Dim dr = e.node.FullPath.split("\\") \'获取生成此节点的行 If e.Node.Text <> "显示所有行" Then Select Case e.Node.Level Case 0 Filter = "[项目名称] = \'" & dr(0) & "\'" Case 1 Filter = "[项目名称] = \'" & dr(0) & "\' And [县] = \'" & dr(1) & "\'" Case 2 Filter = "[项目名称] = \'" & dr(0) & "\' And [县] = \'" & dr(1) & "\' And [乡] = \'" & dr(2) & "\'" Case 3 Filter = "[项目名称] = \'" & dr(0) & "\' And [县] = \'" & dr(1) & "\' And [乡] = \'" & dr(2) & "\' And [村] = \'" & dr(3) & "\'" Case 4 Filter = "[项目名称] = \'" & dr(0) & "\' And [县] = \'" & dr(1) & "\' And [乡] = \'" & dr(2) & "\' And [村] = \'" & dr(3) & "\' And [屯] = \'" & dr(4) & "\'" Case 5 Filter = "[项目名称] = \'" & dr(0) & "\' And [县] = \'" & dr(1) & "\' And [乡] = \'" & dr(2) & "\' And [村] = \'" & dr(3) & "\' And [屯] = \'" & dr(4) & "\'And [组] = \'" & dr(5) & "\'" End Select End If DataTables("S征地记录").save If User.Name = "开发者" Or User.Name = "管理员" Then DataTables("S征地记录").LoadFilter = filter DataTables("S征地记录").LoadOrder="协议书编号 Desc" DataTables("S征地记录").LoadTop= 5 DataTables("S征地记录").Load Tables("S征地记录").sort="协议书编号" Else DataTables("S征地记录").loadfilter = "(乡 = \'" & User.Name & "\' or 县 = \'" & User.Name & "\' or 项目名称 = \'" & User.Name & "\') and " & Filter DataTables("S征地记录").LoadOrder="协议书编号 Desc" DataTables("S征地记录").LoadTop= 5 DataTables("S征地记录").Load Tables("S征地记录").sort="协议书编号" End If \'Tables("S征地记录").filter = filter 第一页按钮代码: With DataTables("S征地记录") .LoadPage = 0 \'加载第一页 .Load() e.Form.Controls("TextBox1").Value = 1 & "/" & .TotalPages End With 上一页 按钮代码: With DataTables("S征地记录") If .LoadPage > 0 Then .LoadPage = .LoadPage - 1 .Load() e.Form.Controls("TextBox1").Value = (.LoadPage + 1) & "/" & .TotalPages End If End With 下一页 按钮代码: With DataTables("S征地记录") If .LoadPage < .TotalPages - 1 .LoadPage = .LoadPage + 1 .Load() e.Form.Controls("TextBox1").Value = (.LoadPage + 1) & "/" & .TotalPages End If End With 最后一页 按钮代码: With DataTables("S征地记录") If .LoadPage < .TotalPages - 1 .LoadPage = .TotalPages - 1 .Load() e.Form.Controls("TextBox1").Value = .TotalPages & "/" & .TotalPages End If End With |
-- 作者:有点蓝 -- 发布时间:2017/12/15 22:09:00 -- …… DataTables("S征地记录").save If User.Name = "开发者" Or User.Name = "管理员" Then DataTables("S征地记录").LoadFilter = filter DataTables("S征地记录").LoadOrder="协议书编号 Desc" DataTables("S征地记录").LoadTop= 5 DataTables("S征地记录").Load Tables("S征地记录").sort="协议书编号" Else DataTables("S征地记录").loadfilter = "(乡 = \'" & User.Name & "\' or 县 = \'" & User.Name & "\' or 项目名称 = \'" & User.Name & "\') and " & Filter DataTables("S征地记录").LoadOrder="协议书编号 Desc" DataTables("S征地记录").LoadTop= 5 DataTables("S征地记录").Load Tables("S征地记录").sort="协议书编号" End If e.Form.Controls("TextBox1").Value = 1 & "/" & .TotalPages …… |
-- 作者:aza520 -- 发布时间:2017/12/15 22:22:00 -- 老师,增加该代码后,出现这个错误: |
-- 作者:有点蓝 -- 发布时间:2017/12/15 22:26:00 -- e.Form.Controls("TextBox1").Value = 1 & "/" & DataTables("S征地记录").TotalPages |
-- 作者:aza520 -- 发布时间:2017/12/15 22:32:00 -- 换成这个代码后,打开项目还是没有及时更新,显示空白。只有点击翻页的时候才会出现 |
-- 作者:有点蓝 -- 发布时间:2017/12/15 22:42:00 -- 打开项目时还没有分页哦 |