防止CFgrid的重复更新
我有一个带有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还没有发布任何代码,但我猜您正在使用带有 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