以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  AddGrid 分组  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=172109)

--  作者:有点蓝
--  发布时间: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

--  作者:有点蓝
--  发布时间: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

--  作者:有点蓝
--  发布时间:2021/10/14 20:50:00
--  
生成的网页是怎么样的
--  作者:有点蓝
--  发布时间: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

--  作者:有点蓝
--  发布时间:2021/10/17 20:51:00
--  
不要那么死板,我连接不到您的数据库,所以测试是直接写死的

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

--  作者:有点蓝
--  发布时间: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编辑过]

--  作者:有点蓝
--  发布时间:2021/10/18 10:51:00
--  
什么错误?
--  作者:有点蓝
--  发布时间:2021/10/18 14:21:00
--  
提示很明显了,加载的表没有分类这一列。sql没有返回这个列