以文本方式查看主题

-  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=137587)

--  作者:z769036165
--  发布时间:2019/7/10 10:06:00
--  weui筛选功能求助!
Sele ct Case e.Path
    Case "table.htm"
        Dim wb As New WeUI
        wb.AddForm("","form1","table1.htm")
        With wb.AddInputGroup("form1","ipg1","筛选")
            .AddInput("xm","姓名","text").Placeholder = "请输入姓名筛选数据"
            .AddInput("pw","部门","text").Placeholder = "请输入部门筛选数据"
        End With
        With wb.AddButtonGroup("form1","btg1",False)  \'垂直排列
            .Add("btn1","筛选","button").Attribute= "oncli ck=\'myfunction()\'"
            .Add("btn1","下载","","http://127.0.0.1/xiazai.htm")
        End With
        With wb.AddTable("","用户表")
            .CreateFromTable(Tables("用户表"),True)
        End With
        wb.AppendHTML("<div id=\'p1\' style=\'margin:0.5em\'></div>") \'插入一个div,用于显示服务器返回的 页面
        wb.AppendHTML("<script src=\'./lib/ajaxform1.js\'></script>") \'引入脚本文件
        e.WriteString(wb.Build)
    Case "table1.htm"
        Dim wb As New WeUI
        \'======================
        Dim txt1 As String = e.PostValues("xm")
        Dim txt2 As String = e.PostValues("pw")
        Dim Filter As String
        Dim tbl As Table = Tables("用户表")
        If txt1 = "" And txt2 = "" Then
            tbl.Filter = ""
        Else
            If txt1 <> "" Then
                txt1 = "\'%" & txt1 & "%\'"
                Filter =  "姓名 Like " & txt1
            End If
            If txt2 <> "" Then
                txt2 = "\'%" & txt2 & "%\'"
                If Filter > "" Then
                    Filter = Filter & " And "
                End If
                Filter = Filter & "部门 Like"  & txt2
            End If
            tbl.Filter = Filter
        End If
        \'=============================
        With wb.AddTable("","用户表")
            .CreateFromTable(Tables("用户表"),True)
        End With
        e.WriteString(wb.Build)
    Case "xiazai.htm"
        Dim Book As New XLS.Book(ProjectPath & "Attachments\\用户表.xls")
        e.WriteBook(book,"用户表.xls",True)
End Select



js代码:
function myfunction(){
    var result = submitAjaxForm(\'form1\',\'\',false);
    document.getElementById("p1").innerHTML=result;
}

请问怎么在打开页面的时候能把表单全部显示出来,在筛选的时候显示在原表上面呢?目前这样变成了建立2个表了。

--  作者:有点蓝
--  发布时间:2019/7/10 10:32:00
--  
Case "table.htm"
    Dim wb As New WeUI
    wb.AddForm("","form1","table1.htm")
    With wb.AddInputGroup("form1","ipg1","筛选")
        .AddInput("xm","姓名","text").Placeholder = "请输入姓名筛选数据"
        .AddInput("pw","部门","text").Placeholder = "请输入部门筛选数据"
    End With
    With wb.AddButtonGroup("form1","btg1",False)  \'垂直排列
        .Add("btn1","筛选","button").Attribute= "oncli ck=\'myfunction()\'"
        .Add("btn1","下载","","http://127.0.0.1/xiazai.htm")
    End With

    wb.AppendHTML("<div id=\'p1\' style=\'margin:0.5em\'>") \'插入一个div,用于显示服务器返回的 页面
    With wb.AddTable("p1","用户表")
        .CreateFromTable(Tables("用户表"),True)
    End With
    wb.AppendHTML("</div>")
    wb.AppendHTML("<script src=\'./lib/ajaxform1.js\'></script>") \'引入脚本文件
    e.WriteString(wb.Build)

--  作者:z769036165
--  发布时间:2019/7/10 14:21:00
--  
没效果啊,
需要打开网页的时候就要显示出用户表的内容,然后输入筛选条件,进行筛选,我前面的打开是显示出用户表的内容,但是一筛选出现2个表,上述这种,第一次打开网页不显示用户表的内容了。

--  作者:有点蓝
--  发布时间:2019/7/10 15:01:00
--  
Case "table.htm"
    Dim wb As New WeUI
    wb.AddForm("","form1","table1.htm")
    With wb.AddInputGroup("form1","ipg1","筛选")
        .AddInput("xm","姓名","text").Placeholder = "请输入姓名筛选数据"
        .AddInput("pw","部门","text").Placeholder = "请输入部门筛选数据"
    End With
    With wb.AddButtonGroup("form1","btg1",False)  \'垂直排列
        .Add("btn1","筛选","button").Attribute= "oncli ck=\'myfunction()\'"
        .Add("btn1","下载","","http://127.0.0.1/xiazai.htm")
    End With

    wb.InsertHTML("<div id=\'p1\' style=\'margin:0.5em\'>") \'插入一个div,用于显示服务器返回的 页面
    With wb.AddTable("","用户表")
        .CreateFromTable(Tables("用户表"),True)
    End With
    wb.InsertHTML("</div>")
    wb.AppendHTML("<script src=\'./lib/ajaxform1.js\'></script>") \'引入脚本文件
    e.WriteString(wb.Build)