以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 如何利用submitAjaxForm传递Table中当前行行关键字? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=108882) |
-- 作者:lanbor -- 发布时间:2017/10/31 14:01:00 -- 如何利用submitAjaxForm传递Table中当前行行关键字? 请教:如何利用submitAjaxForm传递Table的当前点击行关键字? 原句如下:test1.htm With wb.Add Table("form1","Table1") .Attribute="onc/ick=""key=\'" & .PrimaryKey & "\';user_power_object()""" ‘ \'这句应该怎么写,才能将:table1.PrimaryKey的通过submitAjaxForm,传递给user_power_object页面。 .PageNumber=page .ActiveSheet="menu1" .Colwidth="12px" .Highlight= 1 .Alternate = 2 Dim nms1() As String={"NO","帐号","姓名","部门","最近操作","最近操作"} Dim nms2() As String={"NO","帐号","姓名","部门","登入","退出"} .head.AddRow(nms1) .head.AddRow(nms2) For Each dr As DataRow In dt.DataRows With .body.addrow(dr("NO.")) .addcell(dr("wID"),"class=\'alignC\'") .addcell(dr("wXM"),"class=\'alignC\'") .addcell(dr("wBM"),"class=\'alignC\'") .AddCell(Format(dr("wlid"),"MM-dd HH:mm")) .AddCell(Format(dr("wlod"),"MM-dd HH:mm")) .PrimaryKey=dr("f_id") End With Next End With With wb.AddButtonGroup("form1","btg21",False) .Add("btn24","返回主页","","default.htm").kind=1 \'生成返回原来页面的按钮 End With //js函数语句,发送Form对象,显示当前用户的操作权限 function user_power_object(){ var result = submitAjax Form(\'form1\',\'\',false); document.getElement ById("p1").innerHTML=result; } 接收方原句如下:user_power_object.htm Dim e As Request EventArgs = args(0) Dim wb As New WeUI \'定义一个东基于WeUI 框架的网页生成器 Dim PrimaryKey As Integer = e.GetValues("key") Dim cmd2 As New SQLCommand cmd2.Conn ecti \'记得设置数据源名称 cmd2.Comm andText = "Select * Fr om (Sel ect Row_Number() Over(Order by f_number) As [NO.],* Fr om {user_power} where f_id= \'"& PrimaryKey &"\' ) As a " Dim dt2 As Data Table = cmd2.Execute Reader \'根据此页数据生成网页 With wb.AddTable("","Table2") .Colwidth="12px" .Highlight= 1 .Alternate = 2 Dim nms1() As String={"NO","项目","功能表(0无权1有权)","功能表(0无权1有权)","功能表(0无权1有权)","功能表(0无权1有权)","功能表(0无权1有权)","功能表(0无权1有权)"} Dim nms2() As String={"NO","项目","新增","修改","删除","审核","上图","查询"} .head.AddRow(nms1) .head.AddRow(nms2) For Each dr2 As DataRow In dt2.DataRows With .body.addrow(dr2("NO.")) .addcell(dr2("f_name"),"class=\'alignC\'") .addcell(dr2("f_add"),"class=\'alignC\'") .addcell(dr2("f_edit"),"class=\'alignC\'") .addcell(dr2("f_del"),"class=\'alignC\'") .addcell(dr2("f_check"),"class=\'alignC\'") .addcell(dr2("f_img"),"class=\'alignC\'") .addcell(dr2("f_view"),"class=\'alignC\'") \' .Prim aryKey=dr("_Identify") \'每行都需要定义上主键 End With Next End With e.Write String(wb.Build) 请教,我应该如何修改: 希望用户在点击“可登录用户信息表的”任意行时,能怎么把当前行的.Prim aryKey 值通过submitAjaxForm 传递给下一函数,并生成一个新的权限表返回到当前页面。 目前我仅能收到一个空表头被返回! [此贴子已经被作者于2017/10/31 14:10:23编辑过]
|
-- 作者:有点甜 -- 发布时间:2017/10/31 14:17:00 -- .Attribute="onclick=\'user_power_object(table1.primarykey)\'"
-------------------
function user_power_object(key){
alert(key);
//这里可以给某个input赋值 http://www.foxtable.com/mobilehelp/scr/0127.htm
var result = submitAjax Form(\'form1\',\'\',false);
document.getElement ById("p1").innerHTML=result;
}
[此贴子已经被作者于2017/10/31 14:18:24编辑过]
|
-- 作者:lanbor -- 发布时间:2017/10/31 16:04:00 -- 学生愚鈍,还请指教! //发送Form对象, 显示当前用户的操作权限 fun ction user_power_object(key){ alert("kye:" + key); 返回了正确数据 这里的(AddHiddenValue(ID,Value)意思明白,主要不懂如何在*.js 文件中写代码 var result = submitAjax Fo rm(\'form1\',\'\',false); document.getElement ById("p1").innerHTML=result; } ’------------------------- 接收方收到数字是 0 Dim e As RequestEventArgs = args(0) Dim wb As New WeUI \'定义一个东基于WeUI 框架的网页生成器 Dim PrimaryKey As Integer = e.getValues("key") Integer.TryParse(e.getValues("key"),PrimaryKey) msgbox("PrimaryKey" & PrimaryKey) ‘看到数据是 0 [此贴子已经被作者于2017/10/31 16:06:09编辑过]
|
-- 作者:有点蓝 -- 发布时间:2017/10/31 17:12:00 -- function user_power_object(key){ document.getElement ById("p1").value=key; var result = submitAjax Form(\'form1\',\'\',false); }
|
-- 作者:lanbor -- 发布时间:2017/10/31 21:26:00 -- 不知道我哪里做错了。 alert(key01) \' 能收到来主Table1属性传来的值.Attribute="" //这接收值的user_power_object.htm 网页中,就是收不到正确的值 Dim e As RequestEventArgs = args(0) Dim wb As New WeUI \'定义一个东基于WeUI 框架的网页生成器 Dim PrimaryKey As Integer = e.getValues("key01") msgbox(e.getValues("key01")) wb.InsertHTML("接收到的数据有:<br/>") wb.InsertHTML("p-key01:" & e.PostValues("key01") & "<br/>") wb.InsertHTML("g-key01:" & PrimaryKey & "<br/>") 显示结果都是:0 再请一下:是哪里做得不对? |
-- 作者:有点蓝 -- 发布时间:2017/10/31 21:43:00 -- js代码,看不懂就不要改 function user_power_object(key){ document.getElement ById("p1").value=key; var result = submitAjax Form(\'form1\',\'\',false); } Dim e As RequestEventArgs = args(0) Dim wb As New WeUI \'定义一个东基于WeUI 框架的网页生成器 Dim PrimaryKey As string = e.postValues("p1") msgbox(PrimaryKey) wb.InsertHTML("接收到的数据有:<br/>") wb.InsertHTML("p-key01:" & PrimaryKey & "<br/>") |
-- 作者:有点蓝 -- 发布时间:2017/10/31 21:46:00 -- 动态页面可以参考这个例子:http://foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=106788&skin=0 |
-- 作者:lanbor -- 发布时间:2017/10/31 22:25:00 -- 谢谢专家不厭其煩的指教! 谢谢专家不厭其煩的指教! 你批评一下,我又学习一点点! 谢谢你了!
|