以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  请教:关闭模态对话框时,父窗体滚动条自动会跳会最顶端  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=128178)

--  作者:bahamute
--  发布时间:2018/11/30 14:36:00
--  请教:关闭模态对话框时,父窗体滚动条自动会跳会最顶端
有时记录多,页面比较长,删改记录时,会弹出模态框确认,操作完成后,页面总是会自动回到最顶端,如何避免这种情况?
[此贴子已经被作者于2018/11/30 15:04:55编辑过]

--  作者:有点甜
--  发布时间:2018/11/30 14:38:00
--  

1、删除确定以后,你是不是刷新了表格?

 

2、你如何写代码删除的?贴出你删除记录的代码?


--  作者:bahamute
--  发布时间:2018/11/30 14:42:00
--  关闭模态对话框时,父窗体滚动条自动会跳会最顶端 后台提交
后台sendAjaxText提交,没有刷新页面。

function HRLogsLockUnlock(bh4){
    var arr = bh4.split("|");
    var result = sendAjaxText(arr[0] + "|LockUnlock","HRLogsListCanDelEditLockUnlock.htm","",false);
    if (result==\'yes\') {
        if(arr[2]==\'锁定\') {
           show("dlg3");
           document.getElementById(arr[1]).innerHTML="解锁";
        }
else{
           show("dlg3");
           document.getElementById("arr[1]).innerHTML="锁定";
}
    }        
    else{
        show("dlg4");
    }
}
[此贴子已经被作者于2018/11/30 15:07:02编辑过]

--  作者:有点甜
--  发布时间:2018/11/30 15:29:00
--  

我测试没问题,做个实例发上来测试

 

Select Case e.Path
    Case "test.htm", ""
        Dim wb As New WeUI
        With wb.AddTable("","Table1")
            .head.AddRow("部门","姓名","年龄","电话","地址") \'表头
            .body.AddRow("技术部","张三","36","110","中国北京") \'数据
            .body.AddRow("技术部","李四","38","110","中国上海")
            .body.AddRow("技术部","王五","39","110","中国深圳")
            .body.AddRow("生产部","赵六","39","110","中国深圳")
            .body.AddRow("生产部","刘七","39","110","中国深圳")
            .body.AddRow("技术部","王五","39","110","中国深圳")
            .body.AddRow("生产部","赵六","39","110","中国深圳")
            .body.AddRow("生产部","刘七","39","110","中国深圳")
            .body.AddRow("技术部","王五","39","110","中国深圳")
            .body.AddRow("生产部","赵六","39","110","中国深圳")
            .body.AddRow("生产部","刘七","39","110","中国深圳")
            .body.AddRow("技术部","王五","39","110","中国深圳")
            .body.AddRow("生产部","赵六","39","110","中国深圳")
            .body.AddRow("生产部","刘七","39","110","中国深圳")
            .body.AddRow("生产部","赵六","39","110","中国深圳")
            .body.AddRow("生产部","刘七","39","110","中国深圳")
            .body.AddRow("技术部","王五","39","110","中国深圳")
            .body.AddRow("生产部","赵六","39","110","中国深圳")
            .body.AddRow("生产部","刘七","39","110","中国深圳")
            .body.AddRow("生产部","赵六","39","110","中国深圳")
            .body.AddRow("生产部","刘七","39","110","中国深圳")
            .body.AddRow("技术部","王五","39","110","中国深圳")
            .body.AddRow("生产部","赵六","39","110","中国深圳")
            .body.AddRow("生产部","刘七","39","110","中国深圳")
        End With
        wb.InsertHTML("<div style=\'height:100px\'></div>")
        wb.AddPage("","page1").Attribute = "style=\'position: fixed;bottom: 0;right: 0;left: 0\'" \'增加两个page
        With wb.AddButtonGroup("page1","btg2", False) \'生成上一页和下一页按钮
            .Add("btnPrev", "上一页","button").Attribute="onclick=""show(\'dlg1\')"""
            .Add("btnNext", "下一页","","List.htm")           
        End With

        With wb.AddDialog("","dlg1", "删除确认","您确定要删除当前记录吗?")
            .AddButton("btnCancel","取消").Kind = 1
            .AddButton("btnOK","确定")
        End With
        e.WriteString(wb.Build)
End Select


--  作者:bahamute
--  发布时间:2018/11/30 17:45:00
--  
  页面内容不是table,而是 PanelGroup    
  
With wb.AddPanelGroup("","pg","时间段:" & FirstDay & "至" & LastDay)
    For i As Integer = 0 To dt.datarows.count - 1
        Dim dr As DataRow = dt.datarows(i)
        
        Dim names() As String
        names = dr("记录人").split("|")
        Dim str As String
        str = names(1)
        If str.Length = 2 Then
            str = str.Insert(1,"&nbsp&nbsp&nbsp&nbsp")
        End If
        
        With .Add("pn" & i,"<label style=\'font-size:16px;font-weight:bold;color:#565656;\'>" & dr("记录名称") & "</lable>",dr("记录内容"))
            .Badge= ""
            .AddFoot(str)
            .AddFoot("|" & dr("事件日期"))
            \'.AddFoot("|详细","HRLogsListDetail.htm?recid=" & dr("记录编号"))
            .AddFoot("<a href=\'HRLogsListDetail.htm?recid=" & dr("记录编号") & "\'>详细</a>")
            .AddFoot("<a href=\'#\' onclick=HRLogsCanEdit(\'" & dr("记录编号") & "\')>编辑</a>")
            .AddFoot("<a href=\'#\' onclick=HRLogsCanDel(\'" & dr("记录编号") & "\')>删除</a>")
            If cs = "409|张三" Then
                If dr("锁定标识")= True Then
                    .AddFoot("<a href=\'#\' id=\'mya" & i & "\' onclick=HRLogsLockUnlock(\'" & dr("记录编号") & "|mya" & i & "|解锁\')>解锁</a>")
                Else
                    .AddFoot("<a href=\'#\' id=\'mya" & i & "\' onclick=HRLogsLockUnlock(\'" & dr("记录编号") & "|mya" & i & "|锁定\')>锁定</a>")
                End If
            End If
            
        End With
    Next
End With

--  作者:有点甜
--  发布时间:2018/11/30 18:34:00
--  

请贴出可以直接测试的代码。或者上传直接可以测试的实例。

[此贴子已经被作者于2018/11/30 18:34:35编辑过]