以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何同时刷新加载树  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=109548)

--  作者:aza520
--  发布时间:2017/11/14 16:28:00
--  如何同时刷新加载树
我在项目LoadUserSetting事件设代码:(根据不同登录用户加载不同数据)
If User.Name = "开发者" Or User.Name = "管理员" Then
    DataTables("S征地记录").LoadFilter = ""
Else
    DataTables("S征地记录").LoadFilter = "乡 = \'" & User.Name & "\' or 县 = \'" & User.Name & "\' or 项目名称 = \'" & User.Name & "\'"
End If
DataTables("S征地记录").Load()


在窗口左侧加载树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征地记录").Load
Else
    DataTables("S征地记录").loadfilter = "(乡 = \'" & User.Name & "\' or 县 = \'" & User.Name & "\' or 项目名称 = \'" & User.Name & "\') and " & Filter
    DataTables("S征地记录").Load
End If

\'Tables("S征地记录").filter = filter(注释代码)

在窗口刷新按钮设置了代码:
DataTables("S征地记录").Load()

用同一用户名在不同电脑登录进行操作,如何才能实现:本电脑点刷新后,能加载另一电脑用户输入的数据,同时也重新根据该用户名能加载的所有数据重新生成加载树?请教老师
如图片示:右侧增加了第4行,左侧刷新后加载了第4行,但如何使加载树也能同时出现‘平安村”

图片点击可在新窗口打开查看此主题相关图片如下:0(j0374p09gw$qqcg4c108r.png
图片点击可在新窗口打开查看



--  作者:有点甜
--  发布时间:2017/11/14 16:32:00
--  

 你可以刷新加载树,参考

 

http://www.foxtable.com/webhelp/scr/2022.htm