以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  WEUI如何隐藏表格列  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=171028)

--  作者:chen_sheng
--  发布时间:2021/8/14 18:06:00
--  WEUI如何隐藏表格列

weui的确好用 但是查询表生成的NO可以做分页用 但是移动端因为显示的问题 想不显示如何处理呢  非常感谢!


S/elect Case e.Path
    C/ase "list.htm"
       
\'
获取要显示的页
        Dim page As Integer = 0
\'
默认page0,显示第一页
        Dim pageRows As Integer = 15
\'
每页15
        If e.GetValues.ContainsKey("page") Then 
\'
如果地址中有page参数
            Integer.TryParse(e.GetValues("page"), page)
\'
提取page参数
        End If
        Dim StartRow As Integer = page * pageRows + 1
\'
此页第一行
        Dim EndRow As Integer = (page + 1) * pageRows
\'
此页最后一行       

        \'获取该页数据
        Dim c md As New SQLCommand
        c md.ConnectionName = "orders"
\'
记得设置数据源名称
        c md.CommandText =
"S/elect Count(*) From {
订单}"
        Dim Count As Integer = c md.ExecuteScalar()
\'
获取总的行数
        c md.CommandText =
"S/elect * From (S/elect Row_Number() Over(Order by
日期) As [NO.], 产品,客户,数量,单价,日期 From 订单) As a "
        c md.CommandText = cmd.CommandText & "  Where [NO.]>= " & StartRow & " And [NO.] <= " & EndRow
        Dim dt As DataTable = cmd.ExecuteReader       

        \'根据此页数据生成网页
       
Dim wb As New WeUI
        With wb.AddTable("","Table1")
            .CreateFromDataTable(dt)

            想隐藏NO.列,如何处理呢 ,NO.列仅做分页标记用
        End With
        With wb.AddButtonGroup("","btg2", False)
            If page > 0 Then
                .Add("btnPrev",
"
上一页","","List.htm?page=" & page - 1)
            End If
            If Endrow < count Then
                .Add("btnNext",
"
下一页","","List.htm?page=" & page + 1)
            End If
        End With
        e.WriteString(wb.Build)

E/nd
S/elect

[此贴子已经被作者于2021/8/14 18:07:48编辑过]

--  作者:binyum
--  发布时间:2021/8/15 16:26:00
--  
 c md.CommandText = "S/elect 产品,客户,数量,单价,日期 From (S/elect Row_Number() Over(Order by 日期) As [NO.], 产品,客户,数量,单价,日期 From 订单) As a "