Foxtable(狐表)用户栏目专家坐堂 → [求助]无法触发datacolchanged事件


  共有272人关注过本帖树形打印复制链接

主题:[求助]无法触发datacolchanged事件

帅哥哟,离线,有人找我吗?
dahai
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:67 积分:607 威望:0 精华:0 注册:2019/1/9 15:59:00
[求助]无法触发datacolchanged事件  发帖心情 Post By:2024/5/21 11:04:00 [只看该作者]


想完成的任务《返仓单》库房确认列 鼠标点击 待返仓—>已返仓,触发了《返仓单》的datacolchanged事件,修改了阿里云后台表《返仓明细》 库房确认列,由待返仓—>已返仓,触发返仓明细的datacolchanged事件。但是发现无法触发《返仓明细》的datacolchanged事件,我在论坛查看了相关问题解答,论坛上说“
只有在foxtable里的表格更改数据才能触发DataColChanged。直接更改后台数据不会触发foxtable的任何事件
我想问的是,有什么好办法能够同步触发吗?



表《返仓单》中的datacolchanged设置代码如下:
If e.DataCol.Name = "库房确认" Then
    If e.OldValue = "待返仓" And e.NewValue = "已返仓" Then
        Dim frs As list(Of DataRow) = DataTables("返仓明细").SQLSelect("返仓单号 = '" & e.DataRow("返仓单号") & "'")
        For Each fr As DataRow In frs
            fr("库房确认") = "已返仓"
            fr.Save()
        Next 
    End If
end if

《返仓明细》的datacolchanged事件代码:
If e.DataCol.Name = "库房确认" Then
    If e.OldValue = "待返仓" And e.NewValue = "已返仓" Then
        Dim fr As DataRow = DataTables("入库明细").SQLFind("入库单号 = '" & e.DataRow("入库单号") & "'")
        If fr IsNot Nothing Then
            e.DataRow("供应商") = fr("供应商")
            e.DataRow("入库用途") = fr("入库用途")
            e.DataRow("入库分类") = fr("分类")
            e.DataRow("备注") = fr("备注")
        End If
     end if
end if

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107440 积分:546479 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/5/21 11:14:00 [只看该作者]

表《返仓单》中的datacolchanged设置代码如下:
If e.DataCol.Name = "库房确认" Then
    If e.OldValue = "待返仓" And e.NewValue = "已返仓" Then
        Dim frs As list(Of DataRow) = DataTables("返仓明细").SQLSelect("返仓单号 = '" & e.DataRow("返仓单号") & "'")
        For Each dr As DataRow In frs
dim s as string = dr("库房确认")
            dr("库房确认") = "已返仓"
if s = "待返仓" then
        Dim fr As DataRow = DataTables("入库明细").SQLFind("入库单号 = '" & dr("入库单号") & "'")
        If fr IsNot Nothing Then
            dr("供应商") = fr("供应商")
            dr("入库用途") = fr("入库用途")
            dr("入库分类") = fr("分类")
            dr("备注") = fr("备注")
        End If
end if
        Next 
DataTables("返仓明细").SQLUpdate(frs)
    End If
end if

SQLSelect必须由SQLUpdate保存:http://www.foxtable.com/webhelp/topics/2901.htm

 回到顶部