以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助] 关于psge2的动态数据 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=137976) |
-- 作者:TINOOOOOOOO -- 发布时间:2019/7/19 14:40:00 -- [求助] 关于psge2的动态数据 Dim e As RequestEventArgs = args(0) Dim wb As New weui Dim cmd As New SQLCommand Dim dt As DataTable cmd.C cmd.CommandText = "SE ECT * from 采购订单" dt = cmd.ExecuteReader() Select Case e.Path Case "frfr.htm" wb.AddPage("","page1") \'增加两个page wb.AddPage("","page2",False) \'第二个 With wb.AddArticle("page1","ar1") Dim i As Integer = 0 For Each dr As DataRow In dt.DataRows With wb.AddPreview("page1","pv" & i ,"含税金额:",dr("含税金额") & "元") .AddItem("单据编号",dr("单据编号")) .AddItem("物料名称",dr("物料名称")) .AddItem("供应商",dr("供应商")) .Addbutton("详细","" , 1,""") i = i + 1 End With Next End With With wb.AddArticle("page2","ar2") With wb.AddTable("page2","Table1") .Highlight = -1 \'关闭高亮显示功能 .head.AddRow("应付","") \'表头 .body.AddRow("数量","") \'数据 .body.AddRow("金额","") End With End With e.WriteString(wb.Build) \'生成网页 End Select 现在页面跳转是正常的了, 想请教老师 要怎么想把表格里面的数据 用动态填充到page2里面。 一定要用到传递主键吗, 那在page里面 如何传递 求助老师 |
-- 作者:TINOOOOOOOO -- 发布时间:2019/7/19 14:44:00 -- psge2 里面想写的是 同一个单号的明细 |
-- 作者:有点蓝 -- 发布时间:2019/7/19 14:54:00 -- 参考:http://www.foxtable.com/mobilehelp/scr/0067.htm |
-- 作者:TINOOOOOOOO -- 发布时间:2019/7/20 9:01:00 -- Dim e As RequestEventArgs = args(0) Dim wb As New weui Dim cmd As New SQLCommand Dim dt As DataTable cmd.C cmd.CommandText = "SE ECT * from 采购订单" dt = cmd.ExecuteReader() Select Case e.Path Case "frfr.htm" wb.AddPage("","page1") \'增加两个page wb.AddPage("","page2",False) \'第二个 With wb.AddArticle("page1","ar1") Dim i As Integer = 0 For Each dr As DataRow In dt.DataRows With wb.AddPreview("page1","pv" & i ,"含税金额:",dr("含税金额") & "元") .AddItem("单据编号",dr("单据编号")) .AddItem("物料名称",dr("物料名称")) .AddItem("供应商",dr("供应商")) .Addbutton("详细","" , 1,"onc ick=""hide(\'page1\');show(\'page2\')""") i = i + 1 End With Next End With With wb.AddArticle("page2","ar2") With wb.AddTable("page2","Table1") .CreateF omDataTable(dt,False,"","","单据编号") End With End With e.WriteString(wb.Build) \'生成网页 End Select 请教老师要怎么把 page1里面的 的单据编号 当做是主键 放到表格筛选条件中去
|
-- 作者:有点蓝 -- 发布时间:2019/7/20 9:44:00 -- 结合这2种帮助的用法:http://www.foxtable.com/mobilehelp/scr/0121.htm frfr.htm …… For Each dr As DataRow In dt.DataRows With wb.AddPreview("page1","pv" & i ,"含税金额:",dr("含税金额") & "元") .AddItem("单据编号",dr("单据编号")) .AddItem("物料名称",dr("物料名称")) .AddItem("供应商",dr("供应商")) .Addbutton("详细","" , 1,"onc ick=""gotopage2(\'" & dr("单据编号") & "\')""") i = i + 1 End With Next End With With wb.AddArticle("page2","ar2") wb.InsertHTML("page2","<div id=\'p1\' style=\'margin:0.5em\'></div>") ------------------------------- gotopage2函数 function gotopage2(bh){ var result = sendAjaxTextsendAjaxText(bh,"other.htm","",false); document.getElementById("p1").innerHTML=result; hide(\'page1\'); show(\'page2\') } -------- other.htm页面的用法参考上面第二个帮助tongji.htm页面的用法动态返回表格数据 也可以参考这里例子里面动态返回表格数据的用法:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=106788&replyID=&skin=1 |
-- 作者:TINOOOOOOOO -- 发布时间:2019/7/22 16:37:00 -- Select Case e.Path Case "cccc.htm" Dim i As Integer = 0 For Each dr As DataRow In dt.DataRows With wb.AddPreview("","pv" & i ,"含税金额:",dr("含税金额") & "元") .AddItem("单据编号",dr("单据编号")) .AddItem("物料名称",dr("物料名称")) .AddItem("供应商",dr("供应商")) .Addbutton("审核", "", 1,"onc ick=""got page2(\'" & dr("单据编号") & "\')""") i = i + 1 End With Next With wb.AddArticle("page2","ar2") wb.InsertHTML("page2","<div id=\'p1\' style=\'margin:0.5em\'></div>") wb.AppendHTML("<script src=\'./lib/got page2.js\'></script>") \'引入脚本文件 End With e.WriteString(wb.Build) End Select ------------ Select Case e.Path Case "other.htm" With wb.AddTable("","Table1") .Highlight = -1 .CreateFr mDataTable(dt,False,e.PostValues("bh"),"","供应商","单据编号") End With e.WriteString(wb.Build) End Select 老师 用你说明的方法 点击按钮 没有跳转反应 js也测试了 好像没有引入。 不知道是哪个写错 或者是出了问题 再次请教老师
|
-- 作者:TINOOOOOOOO -- 发布时间:2019/7/22 16:39:00 -- js文件地址 应该是没有问题的 |
-- 作者:有点蓝 -- 发布时间:2019/7/22 16:50:00 -- gotpage2.js文件内容发上来看看 |
-- 作者:TINOOOOOOOO -- 发布时间:2019/7/22 16:52:00 -- function gotopage2(bh){ alert(bh) var result = sendAjaxTextsendAjaxText(bh,"other.htm","",false); document.getElementById("p1").innerHTML=result; hide(\'page1\'); show(\'page2\') } 就是复制老师的
|
-- 作者:TINOOOOOOOO -- 发布时间:2019/7/22 16:53:00 -- 加了一个 弹出测试 |