Foxtable(狐表)用户栏目专家坐堂 → 窗口表的列


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

主题:窗口表的列

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/8/1 16:32:00 [只看该作者]

以下是引用seal51在2017/8/1 16:30:00的发言:
是的, 去掉这句代码, 正常!

 

去查看你这个函数的代码,贴出来看看。肯定有隐藏列的设置。


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


加好友 发短信
等级:八尾狐 帖子:1837 积分:12984 威望:0 精华:0 注册:2013/6/10 9:23:00
  发帖心情 Post By:2017/8/1 17:10:00 [只看该作者]

这个函数的代码:

 

For Each t As Table In Tables
    t.Visible = True
    t.AllowEdit = True
    For Each c As Col In t.Cols
        c.Visible = True
        c.AllowEdit = True
    Next
Next
Tables("XsGrantTable").Visible = (User.Type <> UserTypeEnum.User )
If User.Type = UserTypeEnum.User Then
    For Each dr As DataRow In DataTables("XsGrantTable").Select("用户名 = '" & User.Name & "'" )
        If dr.IsNull("列名") Then
            Tables(dr("表名")).Visible = Not dr("不可见")
            Tables(dr("表名")).AllowEdit = Not dr("不可编辑")
        Else
            Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见")
            Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑")
        End If
    Next
End If

 

如何保留呢?



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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/8/1 17:35:00 [只看该作者]

 你12楼的代码,相当于是重新设置了表列的显示,你勾选的那些肯定是无效的。

 

 方法一:把代码去掉,不要写;

 

 方法二:你直接在afterLoad事件排除

 

 

For Each t As Table In Tables

    If t.name = "表C" Then continue for
    t.Visible = True
    t.AllowEdit = True
    For Each c As Col In t.Cols
        c.Visible = True
        c.AllowEdit = True
    Next
Next
Tables("XsGrantTable").Visible = (User.Type <> UserTypeEnum.User )
If User.Type = UserTypeEnum.User Then
    For Each dr As DataRow In DataTables("XsGrantTable").Select("用户名 = '" & User.Name & "'" )

        If dr("表名") = "表C" Then continue for
        If dr.IsNull("列名") Then
            Tables(dr("表名")).Visible = Not dr("不可见")
            Tables(dr("表名")).AllowEdit = Not dr("不可编辑")
        Else
            Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见")
            Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑")
        End If
    Next
End If

[此贴子已经被作者于2017/8/1 17:35:31编辑过]

 回到顶部
总数 13 上一页 1 2