以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 动态列表 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=125781) |
-- 作者:刘林 -- 发布时间:2018/10/6 22:47:00 -- 动态列表 If e.PostValues.Count = 0 Then wb.InsertHTML("<br>") Dim xds As List(of String) = DataTables("学校信息").GetValues("学段","单位全称= \'" & dr("group") & "\'") With wb.AddInputGroup("form1","ipg1") Dim xd=.AddSelect("xd","选择学段:","|" & String.Join("|",xds.ToArray)) xd.attribute="style =\'border:none;padding:0px;height:45px;width:100%;margin:10px;font-size:16px;padding-left:0px;color:blue;\'" Dim ksmc=.AddSelect("ksmc", "考试名称:","") ksmc.attribute="style =\'border:none;padding:0px;height:45px;width:100%;margin:10px;font-size:16px;padding-left:0px;color:blue;\'" .AddSelect("bjqc", "班级全称:","").Attribute=CL .AddSwitch("px","是否排序:",False) .AddSwitch("zh","是否折合:",False) End With function getBrands1(){ var xd=document.getElementById("xd").value; setOptions("ksmc",document.getElementById(xd).innerHTML); } 请问老师: 1\\现在是当选学段时,提出学段成绩表中的所有不同考试名称作为第二个选择内容,当选第二个选择框时,提出所有学段和考试名称中的不同班级全称作第三个选择框内容,这该如何 做? 2\\当作了选择返回该页时,学段必须要选一个其他值,第二个选择框考试名称才有下拉内容,否则第二个选择框就没有下拉内容,这是什么原因,怎么办? |
-- 作者:有点蓝 -- 发布时间:2018/10/7 9:55:00 -- 不要刷新当前页,其它选择操作都使用ajex处理 |
-- 作者:刘林 -- 发布时间:2018/10/7 10:29:00 -- 没有刷新 Dim e As RequestEventArgs = args(0) Dim wb As New weui Dim nms() As String Dim cps() As String Dim Ls As String = "style= \'border:none;padding:0px;height:25px;margin:0;width:100%;color:blue;padding-left:10px;font-size:16px;\'" Dim cl As String="style= \'border:none;padding:0px;margin:0;height:45px;width:100%;margin:10px;font-size:16px;padding-left:0px;color:blue;" Dim dr As DataRow = DataTables("用户").SQLFind("[身份证号] = \'" & e.Cookies("UserName") & "\' And [是否可用] = \'true\'") Dim lst As List(of DataRow) wb.InsertHTML("<!DOCTYPE html>") wb.InsertHTML("<html>") wb.InsertHTML("<head>") wb.InsertHTML("<meta charset=\'utf-8\'>") wb.InsertHTML("<meta name=\'viewport\' c />") wb.InsertHTML("<link href=\'../mui/css/mui.css\' rel=\'stylesheet\'/>") wb.InsertHTML("<script Type=\'text/javascript\' charset=\'utf-8\'>mui.init();</script>") wb.InsertHTML("<script src=\'../mui/js/mui.min.js\'></script>") wb.InsertHTML("<title></title>") wb.InsertHTML("</head>") wb.InsertHTML("<body>") wb.InsertHTML("<header class=\'mui-bar mui-bar-nav mui-bar-nav-bg\'>") wb.InsertHTML("<a href=\'javascript:history.back(-1)\' id=\'icon-menu\' class=\'mui-action-back mui-icon mui-icon-left-nav mui-pull-left\' ></a>") wb.InsertHTML("<h1 class=\'mui-title\'>查询选择</h1>") wb.InsertHTML("</header>") wb.InsertHTML("<div class=\'mui-content\'>") wb.AddForm("","form1","jwcxscjsy.htm") If e.PostValues.Count = 0 Then Dim xds As List(of String) = DataTables("学校信息").GetValues("学段","单位全称= \'" & dr("group") & "\'") With wb.AddInputGroup("form1","ipg1") Dim xd=.AddSelect("xd","选择学段:","|" & String.Join("|",xds.ToArray)) count>0时显示数据,用顶部返回时这个学段值在 xd.attribute="style =\'border:none;padding:0px;height:45px;width:100%;margin:10px;font-size:16px;padding-left:0px;color:blue;\'" Dim ksmc=.AddSelect("ksmc", "考试名称:","") count>0时显示数据,用顶部返回时这个考试名称值不在,要重选学段值才有下拉 ksmc.attribute="style =\'border:none;padding:0px;height:45px;width:100%;margin:10px;font-size:16px;padding-left:0px;color:blue;\'" .AddSelect("bjqc", "班级全称:","").Attribute=CL .AddSwitch("px","是否排序:",False) .AddSwitch("zh","是否折合:",False) End With With wb.AddButtonGroup("form1","btg1",True) Dim bt1= .Add("btn1", "确定", "submit") bt1.Attribute = "style=\'border:1px solid black;border-radius:20px;padding:0px;width:50%\'" bt1.kind=1 End With \' wb.AppendHTML("<script src=\'./lib/ajx.js\'></script>") For Each xd As String In xds wb.InsertHTML("<p hidden id=\'" & xd & "\'>" & "|" & DataTables("成绩").sqlGetComboListString("考试名称","学段=\'" & xd & "\'","考试名称 desc") & "</p>") Next wb.AppendHTML("<script src=\'./lib/brands.js\'></script>") \'引入脚本文件 e.WriteString(wb.Build) \'生成网页 Else If e.PostValues("xd")="初中" If e.PostValues("zh")= "on" If e.postvalues("px")="on" 因为返回时第一个选择框xd值还在,但第二个选择框ksmc就不再,要将第一个重选某个值,第二个才有,请问怎么办?
[此贴子已经被作者于2018/10/7 10:30:52编辑过]
|
-- 作者:有点蓝 -- 发布时间:2018/10/7 10:40:00 -- count>0时直接取xd值,通过d值获取ksmc的下拉,赋值给ksmc .AddSelect("ksmc", "考试名称:","过d值获取ksmc的下拉")
|
-- 作者:刘林 -- 发布时间:2018/10/7 10:46:00 -- 哦,我没说对,应该是当count>0,有显示表格后返回时应该是没有刷新,因为xd选择框的值还在,但之前选ksmc的值不在了,且下拉内容为空,要changed学段值,考试名称下拉才有 |
-- 作者:有点蓝 -- 发布时间:2018/10/7 10:59:00 -- 不同浏览器对返回的处理方式都不一样。这个没有办法控制,只能强制刷新 如果使用hbuilder,应该有对应的api的,这个自己到hbuilder官网找找
|
-- 作者:刘林 -- 发布时间:2018/10/7 13:23:00 -- http://www.foxtable.com/mobilehelp/ 这个例子中如果品牌下还有型号,第三个下拉中再做型号选择怎么做?
|
-- 作者:有点蓝 -- 发布时间:2018/10/7 14:04:00 -- 看示例二:http://www.foxtable.com/mobilehelp/scr/0096.htm |
-- 作者:刘林 -- 发布时间:2018/10/7 14:34:00 -- If e.PostValues.Count = 0 Then Dim xds As List(of String) = DataTables("学校信息").GetValues("学段","单位全称= \'" & dr("group") & "\'") With wb.AddInputGroup("form1","ipg1") Dim xd1=.AddSelect("xd","选择学段:","|" & String.Join("|",xds.ToArray)) xd1.Attribute = "onc hange=""setAjaxOptions(\'ksmc\',\'xslb.htm\',\'xd\',false);""style =\'border:none;padding:0px;height:45px;width:100%;margin:10px;font-size:16px;padding-left:0px;color:blue;\'" Dim ksmc1=.AddSelect("ksmc", "考试名称:","") ksmc1.Attribute = "onch ange=""setAjaxOptions(\'bjqc\',\'xslb.htm\',\'xd\',\'ksmc\',false)""" \'ksmc.attribute="style =\'border:none;padding:0px;height:45px;width:100%;margin:10px;font-size:16px;padding-left:0px;color:blue;\'" .AddSelect("bjqc", "班级全称:","").Attribute=CL .AddSwitch("px","是否排序:",False) .AddSwitch("zh","是否折合:",False) End With Case "xslb.htm" \'Dim pps As String = DataTables("成绩").sqlGetComboListString("考试名称","学段=\'" & e.PostValues("xd") & "\'","考试名称 desc") \'e.WriteString(pps) Dim vals As String If e.PostValues.ContainsValue("xd") vals = DataTables("成绩").sqlGetComboListString("考试名称","学段=\'" & e.PostValues("xd") & "\'","考试名称 desc") End If If e.PostValues.ContainsValue("xd") And e.PostValues.ContainsValue("ksmc") vals = "|" & DataTables("成绩").sqlGetComboListString("班级全称", "学段= \'" & e.PostValues("xd") & "\' and 考试名称= \'" & e.PostValues("ksmc") & "\'") End If e.writestring(vals) 老师,我这样改后面两个下拉都没有 [此贴子已经被作者于2018/10/7 14:35:42编辑过]
|
-- 作者:刘林 -- 发布时间:2018/10/7 14:41:00 -- 找到了 If e.PostValues.Containseky("xd") |