Foxtable(狐表)用户栏目专家坐堂 → 多选加载问题


  共有6761人关注过本帖树形打印复制链接

主题:多选加载问题

帅哥哟,离线,有人找我吗?
lsfdf
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:200 积分:2454 威望:0 精华:0 注册:2011/12/14 20:48:00
多选加载问题  发帖心情 Post By:2013/3/11 14:41:00 [只看该作者]

改了个多选加载,加载时没问题,但取消全部节点时,加载了全部内容,数据有点多,我想不加载任何内容,该如何改呢
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String
For Each nd As WinForm.TreeNode In e.node.Nodes '同步子节点选中状态
    nd.Checked = e.Node.Checked
Next
If e.node.ParentNode IsNot Nothing Then '去掉父节点选中状态
    e.node.ParentNode.Checked = False
End If
For Each nd As WinForm.TreeNode In trv.AllNodes
    If nd.Level > 0 AndAlso nd.ParentNode.Checked Then '如果父节点选中
        Continue For '跳过此节点,处理下一结点
    End If
   
    If nd.Checked Then
        If flt > "" Then
            
            flt = flt & " Or "  '注意用or而不是And
            
        End If
        Select Case e.Node.Level
            Case 0
                flt = flt & "( 统计年度 = '" & nd.Text & "')"
            Case 1
                flt = flt & "( 统计年度 = '" & nd.ParentNode.Text & "' And 统计月份 = '" & nd.Text & "')"
            Case 2
                flt = flt & "( 统计年度 = '" & nd.ParentNode.ParentNode.Text & "' And 统计月份 = '" & nd.ParentNode.Text & "' and 通知日期 = # " & nd.Text & " #)"
        End Select
    End If
Next
DataTables("销售订单").LoadFilter = flt
DataTables("销售订单").Load()
DataTables("明细").Load()

 回到顶部
帅哥哟,离线,有人找我吗?
muhua
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:等待验证 帖子:3855 积分:20692 威望:0 精华:5 注册:2012/6/21 14:03:00
  发帖心情 Post By:2013/3/11 15:16:00 [只看该作者]

用户已被锁定

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251048 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/3/11 15:56:00 [只看该作者]

Dim trv As WinForm.TreeView = e.Sender
Dim flt As String
For Each nd As WinForm.TreeNode In e.node.Nodes '同步子节点选中状态
    nd.Checked = e.Node.Checked
Next
If e.node.ParentNode IsNot Nothing Then '去掉父节点选中状态
    e.node.ParentNode.Checked = False
End If
For Each nd As WinForm.TreeNode In trv.AllNodes
    If nd.Level > 0 AndAlso nd.ParentNode.Checked Then '如果父节点选中
        Continue For '跳过此节点,处理下一结点
    End If
    If nd.Checked Then
        If flt > "" Then
            flt = flt & " Or "  '注意用or而不是And
        End If
        Select Case e.Node.Level
            Case 0
                flt = flt & "( 统计年度 = '" & nd.Text & "')"
            Case 1
                flt = flt & "( 统计年度 = '" & nd.ParentNode.Text & "' And 统计月份 = '" & nd.Text & "')"
            Case 2
                flt = flt & "( 统计年度 = '" & nd.ParentNode.ParentNode.Text & "' And 统计月份 = '" & nd.ParentNode.Text & "' and 通知日期 = # " & nd.Text & " #)"
        End Select
    End If
Next
If flt = "" Then
   flt = "[_Identify] Is Null"
End If
DataTables("销售订单").LoadFilter = flt
DataTables("销售订单").Load()
DataTables("明细").Load()

 回到顶部