加好友 发短信
等级:童狐
帖子:200
积分:2567
威望:0
精华:0
注册:2016/11/9 19:13:00
|
EXWEUI搜索控件的应用求助 Post By:2023/6/28 13:50:00 [显示全部帖子]
下面这段代码是搜索控件的示例,我想在没有做输入条件值时,即进入该页面时,默认是全部的列表,当有输入搜索条件时,列表才过滤符合条件的内容。下面这段代码要怎么改?
- Select Case e.Path
- Case "testsearchbar.htm"
- Dim wb As New weui
- wb.AppendHTML("<link rel='stylesheet' href='./weui/exweui.css'/>",True) '引入样式2文件
- wb.AppendHTML("<script src='./weui/exweui.js' ></script>",True) '引入框架文件
- With wb.AddTabBar("", "tb1", 0)
- .AddPage("page1","消息","./images/消息.png")
- .AddPage("page2","通讯录","./images/通讯录.png")
- .AddPage("page3","工作台","./images/工作台.png")
- .AddPage("page4","我","./images/我.png")
- End With
- With ExWeUI.WebUI.AddSearchBar("bar01")
- .DataFunc ="test"
- .CancelFunc="testcancel"
- wb.InsertHTML("page1",.BuildHtml)
- End With
- wb.InsertHTML("page1","<br/>")
- With ExWeUI.WebUI.AddSearchBar("bar02",,True)
- .DataFunc ="test"
- .DataUrl = "getSelect1"
- .CancelFunc="testcancel"
- wb.InsertHTML("page1",.BuildHtml)
- End With
- wb.InsertHTML("page1","<div id='p1' style='margin:0.5em'></div>") '插入一个div,用于显示服务器返回的数据
- wb.AppendHTML("<script src='./weui/test.js' ></script>") '引用查询函数和取消函数所在的js文件
- wb.AppendHTML("<script>initExWeUI();</script>")
- e.WriteString(wb.Build)
- Case "getSelect1"
- Dim filter As String = "1=2"
- If e.PostValues.ContainsKey("value") Then
- filter = "省市 like '%" & e.PostValues("value") & "%'" ’使用模糊查询
- End If
- e.WriteString("|" & DataTables("行政区域").GetComboListString("省市",filter))
- Case "getSr.htm"
- Dim jo As JObject = JObject.Parse(e.PlainText)
- Dim wb As New WeUI
- Dim txt As String = "Foxtable 2022已经发布, 更方便的BOM数据处理和应用.."
- Dim s As String = jo("value").ToString
- With wb.AddPanelGroup("","pg1", s & "列表")
- For i As Integer = 1 To 3
- .Add("pn" & i,s & "新闻" & i,txt,"./images/button.png","http://www.foxtable.com")
- Next
- End With
- e.WriteString(wb.Buildhtml("pg1"))
- End Select
|
|