With wb.AddTable("fm1","tab")
.PrimaryKey = "学号" '加上主键
.ColWidth = "35,20,30,80"
.CreateFromDataTable(cmd.Execute Reader,False,"","学号","姓名","性别","年级","备注")
.Attribute = "on click=""get info()""" //想点击某一行,下面的input能显示对应记录信息
End With
With wb.AddInputGroup("fm1","ipg1","详情")
.AddInput("姓名","姓名","text")
.AddInput("性别","性别","text")
//其他代码略
end with
HttpRequest代码为(弹窗也会有显示):
Case "getinfo.htm"
Dim dr As DataRow = DataTables("学生信息").sqlFind("学号='" & e.PlainText & "'")
If dr IsNot Nothing Then
'msgbox(dr("学号")) //有弹窗
e.WriteString(dr("学号") & "|" & dr("姓名") & "|" & dr("性别") & "|" & dr("年级") & "|" & dr("备注") )
End If
JS代码为:
function getinfo(){
// alert(tab.primarykey);
var result = sendAjaxText(tab.primarykey,"getinfo.htm","",false);
// alert(result);
var vals=result.split("|");
// alert(vals[1]);
document.getElementById("姓名").innerHTML=vals[1];
}
现在的情况是:代码里的弹窗都能正常弹出,弹出数据也正确,就是不能往控件里写值。