在 itemEditEnd 事件之前从 itemEditor 提交新值

发布于 2024-08-04 05:30:41 字数 567 浏览 4 评论 0原文

我有一个 DataGrid,在几列中将 itemEditor 作为 NumericStepper 。当编辑 DataGrid 中的值时,我想更新屏幕上显示的几个值,因此想调用 updateValues() 函数。

首先,我将此函数添加到 DataGriditemEditEnd 事件中,但在新值更新到 dataProvider 之前调用该函数,并且因此,我在函数中拥有的值是旧值。将值更新到 dataProvider 后是否会触发任何其他事件?或者我错过了什么?

其次,我尝试将此函数放入每个 itemEditor 的更改事件中(废话!),但话又说回来,更改事件被触发,但 dataProvider 中的值是旧的。

有什么办法可以让函数 updateValues() 被调用,每次编辑一个值并将其更新到 dataProvider 中时,因为我从那里获取值?

多谢。

I have a DataGrid, with itemEditor as NumericStepper in a few columns. When a value in the DataGrid is edited, I would like to update several values displayed on the screen, and so want to call a updateValues() function.

First, I added this function to itemEditEnd event of the DataGrid, but the function is getting called before the new value is updated into the dataProvider and hence, the values I have in the function are the old values. Is there any other event that is fired after the values are updated into the dataProvider? or am I missing something?

Second, I tried putting this function in the change event of each itemEditor (duh!), but then again, the change event is fired, but the values in the dataProvider are the old ones.

Is there any way I can make the function updateValues() be called, every time a value is edited AND updated into the dataProvider, because there's where I am taking the values from?

Thanks a lot.

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

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

发布评论

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

评论(1

时光无声 2024-08-11 05:30:41

“在事件侦听器中,您可以检查输入到项目编辑器中的数据。如果数据不正确,您可以调用 PreventDefault() 方法来阻止 Flex 将新数据传递回基于列表的控件,并且关闭编辑器。” (来源

所以是的,它被调用在数据提供者拥有数据之前。

您应该阅读以下内容:检测数据网格编辑。他谈论的都是同样的事情。活动优先权是门票。 Flex 方式过于复杂。干杯。

"In your event listener, you can examine the data entered into the item editor. If the data is incorrect, you can call the preventDefault() method to stop Flex from passing the new data back to the list-based control and from closing the editor." (source)

So yeah, it gets called before the dataprovider has the data.

Here's what you should read: Detecting Datagrid Edits. He talks about all the same stuff. Event priority is the ticket. Overly complicated is the Flex way. Cheers.

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