以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  grid 图片不显示  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=119934)

--  作者:fubblyc
--  发布时间:2018/6/4 14:34:00
--  grid 图片不显示

奇怪,一个 grid 有显示小图,
另一个没有。
同样的路径的图片
这个不显示:
With wb.AddGrid("","g1")
    For Each dr As DataRow In DataTables("JSAPI").sqlselect("")
        .Add(dr("product_id"),dr("商品名称"),"./images/button.png").Attribute = " & dr("product_id") & "\')"""
    Next
End With

这个有显示:
      With wb.AddGrid("","g1")
            .Add("c01","扫码支付", "./images/button.png", "nativepay/index.htm")
            .Add("c02","公众号支付", "./images/button.png", "jsapipay/index.htm")
            .Add("c03","公众号支付测试用例", "./images/button.png", "jsapipay/test.htm")
        End With



图片点击可在新窗口打开查看此主题相关图片如下:微信截图_20180604143742.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:微信截图_20180604143729.png
图片点击可在新窗口打开查看


--  作者:有点甜
--  发布时间:2018/6/4 15:03:00
--  

1、是否有错误提示?

 

2、贴出完整代码,包括自动隐藏了的代码。


--  作者:fubblyc
--  发布时间:2018/6/4 15:09:00
--  
甜老师,完整代码:

\'公众号内支付测试用例网页,调用jssdk
Dim e As RequestEventArgs = args(0)

Dim wb As New weui
wb.AddTopTips("","toptip1","请选择经办人信息!")
wb.AddPageTitle("","pageheader","微信充值卡","公司")
wb.AddForm("","form1","test.htm") 
With wb.AddInputGroup("form1","ipg2","经办人信息")
    .AddInput("dp","经办店铺","text").Placeholder = "请选择经办店铺"
    .AddInput("xm","经办人","text").Placeholder = "请选择经办人姓名"
    .AddHiddenValue("订单编号","0010")
End With
With wb.AddInputGroup("form1","ipg3","充值金额")
End With

With wb.AddGrid("","g1")
    For Each dr As DataRow In DataTables("JSAPI").sqlselect("")
        .Add(dr("product_id"),dr("商品名称"),"./images/button.png").Attribute = " & dr("product_id") & "\')"" "  
    Next
End With
wb.AppendHTML("<script src=\'../lib/pay.js\'></script>") \'引入脚本文件
e.WriteString(wb.Build) \'生成网页

--  作者:有点甜
--  发布时间:2018/6/4 15:13:00
--  

With wb.AddGrid("","g1")

 

改成

 

With wb.AddGrid("form1","g1")

 

-----------------------------

 

.Attribute 后面的代码,尝试删掉。

 

-------------------------------

 

如果还不行,替换成下面的代码测试(在原页面测试)

 

            .Add("c01","扫码支付", "./images/button.png", "nativepay/index.htm")
            .Add("c02","公众号支付", "./images/button.png", "jsapipay/index.htm")
            .Add("c03","公众号支付测试用例", "./images/button.png", "jsapipay/test.htm")

--  作者:fubblyc
--  发布时间:2018/6/4 15:26:00
--  
甜老师,奇怪了,两者都不行。。。


Dim wb As New weui
wb.AddTopTips("","toptip1","请选择经办人信息!")
wb.AddPageTitle("","pageheader","微信充值卡","公司")
wb.AddForm("","form1","test.htm") 
With wb.AddInputGroup("form1","ipg2","经办人信息")
    .AddInput("dp","经办店铺","text").Placeholder = "请选择经办店铺"
    .AddInput("xm","经办人","text").Placeholder = "请选择经办人姓名"
    .AddHiddenValue("订单编号","0010")
End With
With wb.AddInputGroup("form1","ipg3","充值金额")
End With

With wb.AddGrid("","g1")
    \'For Each dr As DataRow In DataTables("JSAPI").sqlselect("")
        \'.Add(dr("product_id"),dr("商品名称"),"./images/button.png")    \'.Attribute = " & dr("product_id") & "\')"" "  
    \'Next
上面那段已经注释了。
下面这个也是图片没显示:
           .Add("c01","扫码支付", "./images/button.png", "nativepay/index.htm")
            .Add("c02","公众号支付", "./images/button.png", "jsapipay/index.htm")
            .Add("c03","公众号支付测试用例", "./images/button.png", "jsapipay/test.htm")

End With
wb.AppendHTML("<script src=\'../lib/pay.js\'></script>") \'引入脚本文件
e.WriteString(wb.Build) \'生成网页

--  作者:fubblyc
--  发布时间:2018/6/4 15:28:00
--  
With wb.AddGrid("form1","g1")

也是不行

--  作者:有点甜
--  发布时间:2018/6/4 15:32:00
--  

httprequest顶部加入代码,输出e.path看看。如

 

output.Logs("日志").add(e.path)
Output.Logs("日志").Save("C:\\test.txt",True)


--  作者:fubblyc
--  发布时间:2018/6/4 15:45:00
--  
原来问题在这里:

host=www.yijiansoft.net
path=jsapipay\\images\\button.png
HttpMethod=GET
poststring=

Case "jsapipay\\test.htm" \'公众号测试用例页面\'
        Functions.Execute("htm_jsapipay_test",e)


甜老师威武!!
[此贴子已经被作者于2018/6/4 15:46:59编辑过]

--  作者:有点甜
--  发布时间:2018/6/4 15:51:00
--  

用绝对路径,如

 

.Add("c01","扫码支付", "/images/button.png", "nativepay/index.htm")