Foxtable(狐表)用户栏目专家坐堂 → AddGrid 分组


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

主题:AddGrid 分组

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


加好友 发短信
等级:超级版主 帖子:106067 积分:539428 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/9/24 8:39:00 [显示全部帖子]

Select Case e.Path
    Case "test.htm"
        Dim wb As New WeUI
        wb.AddPageTitle("","pageheader","WeUI","微信网页设计样式库")
        wb.InsertHTML("<h3 align='left' style='margin-top:5px'>分组1</h3>")
        With wb.AddGrid("","g1")
            .Add("c1","Button", "./images/button.png").Attribute = ""
            .Add("c2","Cell", "./images/cell.png", "http://www.foxtable.com")
            .Add("c3","Toast", "./images/toast.png", "http://www.foxtable.com")
            .Add("c4","Dialog", "./images/dialog.png", "http://www.foxtable.com")
            .Add("c5","Progress", "./images/progress.png", "http://www.foxtable.com")
            .Add("c6","Msg", "./images/msg.png", "http://www.foxtable.com")
        End With
        wb.InsertHTML("<h3 align='left' style='margin-top:5px'>分组2</h3>")
        With wb.AddGrid("","g2")
            .Add("c7","Article", "./images/article.png", "http://www.foxtable.com")
            .Add("c8","ActionSheet", "./images/actionSheet.png", "http://www.foxtable.com")
            .Add("c9","Icons", "./images/icons.png", "http://www.foxtable.com")
            .Add("c10","Panel", "./images/panel.png", "http://www.foxtable.com")
            .Add("c11","Tab", "./images/tab.png", "http://www.foxtable.com")
            .Add("c12","SearchBar", "./images/search.png", "http://www.foxtable.com")
        End With
        e.WriteString(wb.Build)
End Select

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


加好友 发短信
等级:超级版主 帖子:106067 积分:539428 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/9/24 9:09:00 [显示全部帖子]

for each s as string in DataTables("网站数据").getvalues("分类","是否启用=true and 大类='城市之家'")
wb.InsertHTML("<h3 align='left' style='margin-top:5px'>" & s & "</h3>")
  With wb.AddGrid("","g" & s)
           For Each dr As DataRow In DataTables("网站数据").select("分类='" & s & "' and 是否启用=true and 大类='城市之家'")
                    .Add(dr("函数名称"),dr("网站中文名"), dr("图标"), dr("网页链接"))
            Next
        End With
next

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


加好友 发短信
等级:超级版主 帖子:106067 积分:539428 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/10/14 20:50:00 [显示全部帖子]

生成的网页是怎么样的

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


加好友 发短信
等级:超级版主 帖子:106067 积分:539428 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/10/16 9:02:00 [显示全部帖子]

下面代码我测试没有问题,如果还是搞不懂请上传实例说明

Select Case e.Path
    Case "test.htm"
        Dim wb As New WeUI
        wb.AddPageTitle("","pageheader","湖南城市之窗",("网页名称"))
        For Each s As String In {"组1","组2"}
            wb.InsertHTML("<h3 align='left' style='margin-top:5px'>" & s & "</h3>")
            With wb.AddGrid("","g" & s)
                For i As Integer = 1 To 4
                    .Add(("函数名称" & i),("网站中文名" & i), ("图标" & i), ("网页链接" & i))
                Next
            End With
        Next
        
        e.WriteString(wb.Build)
End Select

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


加好友 发短信
等级:超级版主 帖子:106067 积分:539428 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/10/17 20:51:00 [显示全部帖子]

不要那么死板,我连接不到您的数据库,所以测试是直接写死的

For Each s As String In {"组1","组2"} 】效果和下面代码完全一样
For Each s As String In DataTables("网站数据").getvalues("分类","是否启用=true and 大类='城市之窗'")

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


加好友 发短信
等级:超级版主 帖子:106067 积分:539428 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/10/18 9:29:00 [显示全部帖子]

看4楼

For Each dr As DataRow In dt.select("分类='" & s & "' and 是否启用=true and 大类='城市之窗家具案例'")
.Add(dr("函数名称"),dr("网站中文名"), dr("图标"), dr("网页链接"))
next
[此贴子已经被作者于2021/10/18 9:30:18编辑过]

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


加好友 发短信
等级:超级版主 帖子:106067 积分:539428 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/10/18 10:51:00 [显示全部帖子]

什么错误?

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


加好友 发短信
等级:超级版主 帖子:106067 积分:539428 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/10/18 14:21:00 [显示全部帖子]

提示很明显了,加载的表没有分类这一列。sql没有返回这个列

 回到顶部