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个表了。