防止CFgrid的重复更新

发布于 2024-11-05 04:36:24 字数 224 浏览 4 评论 0原文

我有一个带有 selectMode="Edit" 的 CFgrid。我再次通过 cfc 将更新方法绑定到 cfgrid。不过,我可以用重复的值更新网格。我可以通过检查现有记录来阻止数据库更新,但我想让用户收到一条消息,表明他的更新不成功。在这种情况下,只有在刷新页面后发现旧值仍然存在时,他才会知道自己的更新没有成功。

我想知道 cfgrid 中是否有任何事件可以触发,以向用户显示他的更新正在尝试复制数据但无法完成。

I have a CFgrid with selectMode="Edit". Again I have an update method binded to the cfgrid via my cfc. However I am ble to update the grid with duplicate values. I can prevent the db from updating by chking for existing record but I wanted to let the user be thrown with a message that his update was not succesful. In this case he will only know of his update not being succesfull only after he has refreshed the page only to find the old value still exist.

I wanted to know if there is any event within the cfgrid which I can trigger to show the user that his update is trying duplicate the data and cannot be completed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

舟遥客 2024-11-12 04:36:30

您还没有发布任何代码,但我猜您正在使用带有 onChange 属性的 HTML 网格来触发编辑?如果是这种情况,那么您还可以使用 onError 属性,然后在数据对 cfthrow 不满意时让 CFC 抛出错误。然后在 onError 处理程序中,您可以根据需要处理错误。您可以在 CF9 此处

You haven't posted any code, but I am guessing you are using an HTML grid with the onChange attribute to trigger the edit? If that is the case, then you can also use the onError attribute and then just have your CFC throw an error if the data is not satisfactory with cfthrow. Then in your onError handler, you can handle the error as you please. You can find more information about working with HTML grids in CF9 here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文