以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  AddCheckGroup模糊查询问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=157193)

--  作者:leiguohui
--  发布时间:2020/10/7 12:06:00
--  AddCheckGroup模糊查询问题
各位老师:
AddCheckGroup复选框可以做模糊查询的吗
类似下面的增加一个模糊查询功能
http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=132228&authorid=0&page=0&star=1

--  作者:有点蓝
--  发布时间:2020/10/7 13:50:00
--  
http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=157191
--  作者:leiguohui
--  发布时间:2020/10/7 17:00:00
--  
蓝老师:这个我会,就是同一个网页不知道参数怎么传递
--  作者:leiguohui
--  发布时间:2020/10/7 17:08:00
--  
Select Case e.Path
Case "test.htm", ""
Dim wb As New WeUI
With wb.AddInputGroup("","ipg1","项目成员")
 With .AddInputCell("审核人") \'通过InputCell增加输入框
                    .AddLabel("姓名","姓名",0) \'增加标签,0显示在左边
                    
                    .AddInput("姓名","Text",1).Placeholder = "可手动输入,以" & "/" & " 隔开"
                    .AddVcodeButton("hym","模糊输入",2).Attribute = "" \'调用js函数

                    
                End With

.AddInput("需求审核人","姓名","Text")
End With

Dim wb21 As New weui
wb21.AddForm("","form3","test.htm")
wb21.InsertHTML("form3","<div id=\'div12\' style=\'overflow-y:auto;height:300px\'>")
\'\'\'
Dim lk As String = Nothing
Dim txt As String = e.PostValues("姓名")    ‘这个参数不会传,通过上面的姓名输入框
txt = "\'%" & txt & "%\'"
Dim gjs11 As List(of String) = DataTables("员工资料").SQLGetValues("姓名","openid <> \'" &  lk  & "\'and 姓名 like " &  txt )
Dim ds1 As Integer =DataTables("员工资料").SQLCompute("Count([姓名])","openid <> \'" &  lk  & "\'and 姓名 like " &  txt )
Dim ary11 As String=  String.Join("|",gjs11.ToArray)
Dim ary12() As String
ary12 = ary11.split("|")
\'\'\'
With wb21.AddCheckGroup("form3","rdg12","浏览器")
For i As Integer = 0 To ds1-1
.Add("bm1" & i, ary12(i))
Next
End With
wb21.InsertHTML("form3","</div>")
\'\'\'
With wb.AddDialog("","dlg2", "请选择",wb21.Build)
\'\'\'
.AddButton("btnCancel11","取消").Kind = 1
Dim str As String = ""
str &= "var s = \'\';"
For i As Integer = 0 To ds1-1
str &= "var c" & i & " = document.getElementById(\'bm1" & i & "\').checked;"
str &= "if(c" & i & "){s = s + \'," & ary12(i) & "\'};"
\'\'\'
Next
str &= "需求审核人.value = s.substring(1)"
.AddButton("btnOK11","确定").Attribute=" & str & """"
\'\'\'
\'\'\'
\'\'\'
End With
wb.AppendHTML("<script src=\'./lib/z.js\'></script>") \'引入脚本文件
e.WriteString(wb.Build) \'生成网页


--  作者:有点蓝
--  发布时间:2020/10/7 17:17:00
--  
如果是ajax,需要使用不同页面,参考:http://www.foxtable.com/mobilehelp/topics/0110.htm
--  作者:leiguohui
--  发布时间:2020/10/7 17:27:00
--  
那复选框可以根据点击先后顺序写入到输入框吗
--  作者:有点蓝
--  发布时间:2020/10/7 17:39:00
--  
这个需要完全使用js控制,添加一个标记控件:http://www.foxtable.com/mobilehelp/topics/0127.htm

然后给每一个复选框加上js点击事件,勾选的时候往标记控件后面添加复选框值。然后提交标记控件的值作为选择结果

--  作者:leiguohui
--  发布时间:2020/10/8 21:13:00
--  
 蓝老师:
 第一步明白了,(如果能用Dialog就好了) 
 第二部选择复选框,内容填写回"需求审核人" 输入框,不会写、能麻烦您帮忙教下吗

http:
Case "test.htm"
        Dim wb As New weui
        wb.AddForm("","form1","tongji.htm")
        With wb.AddInputGroup("form1","ipg1","销售统计")
.AddInput("姓名","姓名模糊查询","Text")
.AddInput("需求审核人","姓名选择","Text")
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "统计", "button").Attribute= ""
        End With
        wb.AppendHTML("<div id=\'p1\' style=\'margin:0.5em\'></div>") \'插入一个div,用于显示服务器返回的页面
        wb.AppendHTML("<script src=\'./lib/tj3.js\'></script>") \'引入脚本文件
        e.WriteString(wb.Build)

    Case "tongji.htm"
        Dim wb As New weui
            Dim lk As String = Nothing
Dim txt As String = e.PostValues("姓名")
txt = "\'%" & txt & "%\'"
Dim gjs11 As List(of String) = DataTables("员工资料").SQLGetValues("姓名","openid <> \'" &  lk  & "\'and 姓名 like " &  txt )
Dim ds1 As Integer =DataTables("员工资料").SQLCompute("Count([姓名])","openid <> \'" &  lk  & "\'and 姓名 like " &  txt )
Dim ary11 As String=  String.Join("|",gjs11.ToArray)
Dim ary12() As String
ary12 = ary11.split("|")
With wb.AddCheckGroup("","rdg12","浏览器")
For i As Integer = 0 To ds1-1
.Add("bm1" & i, ary12(i))
Next
End With
e.WriteString(wb.Build) 


JS:

function tongji2(){
    var result = submitAjaxForm(\'form1\',\'\',false);
    document.getElementById("p1").innerHTML=result;
}








[此贴子已经被作者于2020/10/8 21:13:01编辑过]

--  作者:有点蓝
--  发布时间:2020/10/9 10:42:00
--  
With wb.AddCheckGroup("","rdg12","浏览器")
For i As Integer = 0 To ds1-1
.Add("bm1" & i, ary12(i)).Attribute = "onclick=\'xxx函(""" & ary12(i) & """)\'"
Next
End With


function xxx函数(v){
    document.getElementById("需求审核人").value=document.getElementById("需求审核人").value + \',\' + v;
}
[此贴子已经被作者于2020/10/11 20:54:29编辑过]

--  作者:leiguohui
--  发布时间:2020/10/11 15:10:00
--  
蓝老师:好像没反应 ,是我写错了吗





Case "test.htm"
        Dim wb As New weui
        wb.AddForm("","form1","tongji.htm")
        With wb.AddInputGroup("form1","ipg1","销售统计")
.AddInput("姓名","姓名模糊查询","Text")
.AddInput("需求审核人","姓名选择","Text")
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "统计", "button").Attribute= ""
        End With
        wb.AppendHTML("<div id=\'p1\' style=\'margin:0.5em\'></div>") \'插入一个div,用于显示服务器返回的页面
        wb.AppendHTML("<script src=\'./lib/tj3.js\'></script>") \'引入脚本文件
        wb.AppendHTML("<script src=\'./lib/tj4.js\'></script>") \'引入脚本文件
        e.WriteString(wb.Build)

    Case "tongji.htm"
        Dim wb As New weui
            Dim lk As String = Nothing
Dim txt As String = e.PostValues("姓名")
txt = "\'%" & txt & "%\'"
Dim gjs11 As List(of String) = DataTables("员工资料").SQLGetValues("姓名","openid <> \'" &  lk  & "\'and 姓名 like " &  txt )
Dim ds1 As Integer =DataTables("员工资料").SQLCompute("Count([姓名])","openid <> \'" &  lk  & "\'and 姓名 like " &  txt )
Dim ary11 As String=  String.Join("|",gjs11.ToArray)
Dim ary12() As String
ary12 = ary11.split("|")
With wb.AddCheckGroup("","rdg12","浏览器")
For i As Integer = 0 To ds1-1
.Add("bm1" & i, ary12(i)).Attribute = ""
Next
End With
e.WriteString(wb.Build) 


JS1:

function tongji2(){
    var result = submitAjaxForm(\'form1\',\'\',false);
    document.getElementById("p1").innerHTML=result;
}


JS2:

function tongji4(){
   document.getElementById("需求审核人").value=document.getElementById("需求审核人").value + \',\' + v;
}