以文本方式查看主题 - 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=173381) |
||||||
-- 作者:wh420 -- 发布时间:2021/11/26 17:57:00 -- WEUI如何获取到列表输入的值进行编辑。 填加新记录使用的是如下方法: Select
Case e.Path Case "test.htm" Dim wb As New weui wb.AddForm("","form1","test.htm") With wb.AddInputGroup("form1","ipg1","动态列表") With .AddSelect("xh","型号","|" & DataTables("表A").GetComboListString("型号")) .Attribute = """ End With With .AddSelect("gg","规格","") .Attribute = """ End With .AddSelect("ys","颜色","") End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With e.WriteString(wb.Build) \'生成网页 Case "getProducts.htm" Dim vals As String If e.PostValues.Count = 1 Then vals = "|" & DataTables("表A").GetComboListString("规格","型号=\'" & e.PostValues("xh") & "\'") ElseIf e.PostValues.Count = 2 Then Dim Filter As String = "型号=\'" & e.PostValues("xh") & "\' And 规格=\'" & e.PostValues("gg") & "\'" vals = "|" & DataTables("表A").GetComboListString("颜色", Filter) End If e.WriteString(vals) End Select 那么编辑该记录时如何获取到列表输入框的值?怎么写
|
||||||
-- 作者:有点蓝 -- 发布时间:2021/11/27 8:46:00 -- 参考:http://www.foxtable.com/mobilehelp/topics/0055.htm |
||||||
-- 作者:wh420 -- 发布时间:2021/11/29 14:07:00 -- 例如普通输入框我编辑的时候使用下面代码可以读出值,但列表框(addselect)的值应该怎么读出来? With .AddInput("money","<img class=\'icon\' src=\'/images/money.png\'> 金额:","number") .Value=dr("money") End With [此贴子已经被作者于2021/11/29 14:07:21编辑过]
|
||||||
-- 作者:有点蓝 -- 发布时间:2021/11/29 14:16:00 -- 意思是给列表框设置一个默认值,不是读列表框值吧,比如 dim s as string = "|" & dr("型号") & "|" dim s1 as string = "|[" & dr("型号") & "]|" dim lst as string = ("|" & DataTables("表A").GetComboListString("型号") & "|").replace(s,s1) With .AddSelect("xh","型号",lst.trimend("|"))
在输入框组增加一个列表输入框的语法为: AddSelect(ID, Label, Values)
|
||||||
-- 作者:wh420 -- 发布时间:2021/11/29 14:21:00 -- 不是给列表框设置值,是读取SQL数据库中的值到列表框(编辑用) |
||||||
-- 作者:有点蓝 -- 发布时间:2021/11/29 14:47:00 -- 没看懂到底什么问题。1楼不就是吗?请截图举例自己的数据和代码说明问题 |
||||||
-- 作者:wh420 -- 发布时间:2021/11/29 14:48:00 -- 我是使用帮助中“动态列表项目三”内的代码来实现记录的添加功能,现在想在“编辑”功能页中读取这些数据到列表框中,并保留级联的功能,应该怎么改? HttpRequest事件代码: Select
Case e.Path |
||||||
-- 作者:有点蓝 -- 发布时间:2021/11/29 14:49:00 -- 没看懂。请截图举例自己的数据和代码说明问题 |
||||||
-- 作者:wh420 -- 发布时间:2021/11/29 15:04:00 -- 老师请看3楼截图,红色框选部分的列表框数据读取不出来(数据在SQL里),并且还要保留这三个列表框的关联效果。代码如下: With wb.AddInputGroup("form1","ipg1","编辑记录") With .AddInput("riqi","<img class=\'icon\' src=\'/images/date.png\'> 日期:","date") .attribute="style=\'color: black;text-align: left;font-size: 14px;font-family:Arial\'" .Value=dr("riqi") End With With .AddSelect("classtype","<img class=\'icon\' src=\'/images/class.png\'> 类别:","|" & DataTables("dict").GetComboListString("Class").replace(dr("classtype"),"[" & dr("classtype") & "]")) .Attribute = """ End With With .AddSelect("itemname","<img class=\'icon\' src=\'/images/item.png\'> 项目:","|" & DataTables("dict").GetComboListString("itemMing").replace(dr("itemname"),"[" & dr("itemname") & "]")) .Attribute = """ End With .AddSelect("detailname","<img class=\'icon\' src=\'/images/name.png\'> 名称:","") With .AddInput("money","<img class=\'icon\' src=\'/images/money.png\'> 金额:","number") .Step="0.01" .attribute="style=\'color: black;text-align: left;font-size: 14px;font-family:Arial\'" .Value=dr("money") End With .AddSelect("shouzhiAcc","<img class=\'icon\' src=\'/images/account.png\'> 账号:","公司账号|备用金|其他账号") .attribute="style=\'color: black;text-align: left;font-size: 14px;font-family:Arial\'" End With 分类表结构如下:
[此贴子已经被作者于2021/11/29 15:05:15编辑过]
|
||||||
-- 作者:有点蓝 -- 发布时间:2021/11/29 15:22:00 -- With .AddSelect("classtype","<img class=\'icon\' src=\'/images/class.png\'> 类别:","|" & DataTables("dict").GetComboListString("Class").replace(dr("classtype"),"[" & dr("classtype") & "]")) .Attribute = "onchange=""setAjaxOptions(\'itemname\',\'getProducts.htm\',\'classtype\',false)""" End With With .AddSelect("itemname","<img class=\'icon\' src=\'/images/item.png\'> 项目:","|" & DataTables("dict").GetComboListString("itemMing","Class=\'" & dr("classtype") & "\'").replace(dr("itemname"),"[" & dr("itemname") & "]")) .Attribute = "onchange=""setAjaxOptions(\'detailname\',\'getProducts.htm\',\'classtype\',\'itemname\',false)""" End With .AddSelect("detailname","<img class=\'icon\' src=\'/images/name.png\'> 名称:","") Case "getProducts.htm"
Dim vals As String If e.PostValues.Count = 1 Then vals = "|" & DataTables("dict").GetComboListString("itemname","Class=\'" & e.PostValues("classtype") & "\'") ElseIf e.PostValues.Count = 2 Then Dim Filter As String = "Class=\'" & e.PostValues("classtype") & "\' And itemname=\'" & e.PostValues("itemname") & "\'" vals = "|" & DataTables("dict").GetComboListString("detailname", Filter) End If e.WriteString(vals) |