在 Flashbuilder 中更改 dataProvider 的 id

发布于 2024-11-08 19:24:57 字数 307 浏览 5 评论 0原文

我为此使用 Flashbuilder。我有一个按钮可以像这样更改 dataProvider 的 id:

result.datagrid.dataProvider="lineup_1";

但是,我还有另一个按钮,在单击时也应该更改 dataprovider 的 id,但是对此:

result.datagrid.dataProvider="lineup_2";

但是,它只响应按下的第一个按钮。之后,id 保持不变,这是逻辑。但我需要知道如何在按下按钮后更改 id。

I'm using Flashbuilder for this. I have a button that changes the id of a dataProvider like this:

result.datagrid.dataProvider="lineup_1";

However, I have another button which should also change the id of the dataprovider when clicked on, but to this:

result.datagrid.dataProvider="lineup_2";

However, it only responds to the first button pressed on. After that, the id stays the same, which is logic. But I need to know how I can change the id after a button is pressed too.

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

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

发布评论

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

评论(1

┾廆蒐ゝ 2024-11-15 19:24:57

如果你说

result.datagrid.dataProvider="lineup_1";

您不更改 dataProvider 的 id,而是更改 dataProvider。因此,在这两个操作中,您都更改了 dataProvider。

更多关于这一点,我认为您需要在更改后刷新您的数据提供程序。像这样的东西:

(result.datagrid.dataProvider as ICollectionView).refresh();

If you say

result.datagrid.dataProvider="lineup_1";

you do not change dataProvider's id, you change the dataProvider. So at both actions, you change the dataProvider.

More on this, I think you need to make a refresh o your dataprovider after changing. Something like :

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