以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- Panel控件加上 Attribute参数 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=183504) |
-- 作者:fendouww -- 发布时间:2022/11/7 21:44:00 -- Panel控件加上 Attribute参数 With wb.AddPanelGroup("","pg2","文字组合列表") .Add("pn1","标题一",txt) \'普通列表 .Add("pn1","标题二",txt,"","http://www.foxtable.com") \'超链接 With .Add("pn2","标题三",txt) \'带有子链接 .AddFoot("文字来源") .AddFoot("时间") .AddFoot("|其他信息","http://www.foxtable.com") End With .GroupFoot = "查看更多" \'底部链接 .GroupHref = "http://www.foxtable.com/" End With 如何给 .AddFoot("|其他信息","http://www.foxtable.com")加上 Attribute参数,而不是跳转网页?如 .Attribute = """
|
-- 作者:fendouww -- 发布时间:2022/11/7 21:45:00 -- 加上这种 |
-- 作者:有点蓝 -- 发布时间:2022/11/7 21:55:00 -- 添加不了。 换种方式,使用浏览器开发者工具找到脚注所在的标签,然后在代码里调用js给标签绑定点击事件
|
-- 作者:fendouww -- 发布时间:2022/11/8 8:53:00 -- 老师,可以具体指导下吗?这是我复制下来的代码 <ul class="weui_media_info"> <li class="weui_media_info_meta"><a href="t">单价: </a></li> <li class="weui_media_info_meta"><a href="t">¥65.00</a></li> <li class="weui_media_info_meta weui_media_info_meta_extra"><a href="t">编辑明细</a></li> <li class="weui_media_info_meta weui_media_info_meta_extra"><a href="t">删除</a></li> <li class="weui_media_info_meta weui_media_info_meta_extra"><a href="t">拉布</a></li> </ul> |
-- 作者:有点蓝 -- 发布时间:2022/11/8 9:16:00 -- 定义一个js函数 function checkedClick() { let eles = exUtils.QueryAll(".weui_media_info_meta a"); for (var i = 0, k = eles.length; i < k; i++) { if (eles[i].innerText == "编辑明细") { eles[i].onclick = 编辑明细函数; } else if (eles[i].innerText == "删除") { eles[i].onclick = 删除函数; } } } httprequest事件 Select Case e.Path Case "test.htm" Dim wb As New WeUI With wb.AddPanelGroup("","pg2","文字组合列表") …… End With wb.InsertHTML("<script>checkedClick()</script>") e.WriteString(wb.Build) \'生成网页 End Select |
-- 作者:fendouww -- 发布时间:2022/11/9 16:12:00 -- With wb2.AddPanelGroup("", "pg1", "") For Each dr As DataRow In dt.Select("", "序号") Dim al As String = "订单号: " & dr("订单号") & " 客户: " & dr("客户") Dim all As String = "件数: " & dr("件数") & " 已裁件数: " & dr("已裁件数") & " 备注:" & dr("备注") all &= "<br>" & "开始日期: " & dr("开始日期") & " 出货日期: " & dr("出货日期") With .Add(dr("序号"), al, all, dr("图片")) \'带子链接 .AddFoot("单价: ") .AddFoot("¥" & Format(dr("单价"), "0.00"), "c") .AddFoot("|编辑明细") .AddFoot("|删除", "c") .AddFoot("|拉布", "c") End With wb2.AppendHTML("<script>checkedClick(""" & dr("_identify") & """)</script>") Next End With su.Append(wb2.BuildHtml("pg1")) 老师,我用以上代码添加,但单击还是指向了链接"c",请问是哪里有问题吗?以下是JS function checkedClick(id) { let eles = exUtils.QueryAll(".weui_media_info_meta a"); for (var i = 0, k = eles.length; i < k; i++) { if (eles[i].innerText == "编辑明细") { eles[i]. + id + ") ;" } else if (eles[i].innerText == "删除") { eles[i]. + id + ") ;" } else if (eles[i].innerText == "拉布") { eles[i]. + id + ") ;" } } } |
-- 作者:有点蓝 -- 发布时间:2022/11/9 16:17:00 -- 如果绑定事件就不要使用链接了 另外判断名称:if (eles[i].innerText == "|编辑明细") { |
-- 作者:fendouww -- 发布时间:2022/11/9 16:32:00 -- 没有链接是不是就无法点击了?然后我调整了下代码和JS,请帮助看看 For Each dr As DataRow In dt.Select("", "序号") With wb2.AddPanelGroup("", "pg" & dr("_identify"), "") Dim al As String = "订单号: " & dr("订单号") & " 客户: " & dr("客户") Dim all As String = "件数: " & dr("件数") & " 已裁件数: " & dr("已裁件数") & " 备注:" & dr("备注") all &= "<br>" & "开始日期: " & dr("开始日期") & " 出货日期: " & dr("出货日期") With .Add(dr("序号"), al, all, dr("图片")) \'带子链接 .AddFoot("单价: ") .AddFoot("¥" & Format(dr("单价"), "0.00")) .AddFoot("|编辑明细") .AddFoot("|删除") .AddFoot("|拉布") End With \' wb2.AppendHTML("<script>checkedClick(""" & dr("_identify") & """)</script>") End With su.Append(wb2.BuildHtml("pg" & dr("_identify"))) su.Append("<script>checkedClick(""" & dr("_identify") & """)</script>") Next 以下是JS function checkedClick(id) { let eles = exUtils.QueryAll(".weui_media_info_meta a"); for (var i = 0, k = eles.length; i < k; i++) { if (eles[i].innerText == "|编辑明细") { eles[i]. + id + ") ;" } else if (eles[i].innerText == "|删除") { eles[i]. + id + ") ;" } else if (eles[i].innerText == "|拉布") { eles[i]. + id + ") ;" } } } //订单Pro_默认页_审核模式_查看明细 function showDetail(upoid) {
hide(\'page1\');
show(\'page2\');
var result = sendAjaxText("", "orderdetail?id=" + upoid + "&vtype=2", "", false);
document.getElementById("page2_divcontent").innerHTML = result; } [此贴子已经被作者于2022/11/9 16:35:23编辑过]
|
-- 作者:有点蓝 -- 发布时间:2022/11/9 16:51:00 -- 请上传实例测试 |
-- 作者:fendouww -- 发布时间:2022/11/9 17:02:00 -- 老师,我用的就是公众号实例,只是把审核者首页的Preview分组替换成了 For Each dr As DataRow In dt.Select("", "序号") With wb2.AddPanelGroup("", "pg" & dr("_identify"), "") Dim al As String = "订单号: " & dr("订单号") & " 客户: " & dr("客户") Dim all As String = "件数: " & dr("件数") & " 已裁件数: " & dr("已裁件数") & " 备注:" & dr("备注") all &= "<br>" & "开始日期: " & dr("开始日期") & " 出货日期: " & dr("出货日期") With .Add(dr("序号"), al, all, dr("图片")) \'带子链接 .AddFoot("单价: ") .AddFoot("¥" & Format(dr("单价"), "0.00")) .AddFoot("|编辑明细") .AddFoot("|删除") .AddFoot("|拉布") End With \' wb2.AppendHTML("<script>checkedClick(""" & dr("_identify") & """)</script>") End With su.Append(wb2.BuildHtml("pg" & dr("_identify"))) su.Append("<script>checkedClick(""" & dr("_identify") & """)</script>") Next 其他的都没有改变 |