Dojox.grid.DataGrid - 在窗口小部件中 - 仅在可见选项卡上呈现 [英] Dojox.grid.DataGrid - in a widget - only renders on visible tab

查看:88
本文介绍了Dojox.grid.DataGrid - 在窗口小部件中 - 仅在可见选项卡上呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用包含DataGrid对象的Widget。当第一个选项卡中包含该窗口小部件(这是可见的选项卡)时,该小部件工作正常,但是在第二个选项卡上使用相同的代码时不会。

I am using a Widget that contains a DataGrid object. The Widget works fine when included in the first tab (this is the visible tab), but not when I use the same code on a second tab.

代码是同样,我已经做了几个检查,以确保没有其他问题 - 非网格代码呈现正常 - 只有网格有问题。我已经尝试手动设置高度和宽度,这只是在第二个选项卡上导致一个大的灰色矩形。

The code is the same I have done several checks to make sure there are no other problems - and non Grid code is rendering fine - only the grid that has a problem. I have tried setting the height and width manually and this just results in a large grey rectangle on the second tab.

我需要告诉网格以某种方式刷新 - 或者它是TabContainer的财产?

Do I need to tell the Grid to refresh in some way - or is it a property for the TabContainer?

帮助 - 这让我疯狂!

Help - this is driving me mad!

推荐答案

是的,这是电网的一个大问题。如果您在标签容器中声明地使用它,则它将无法在不可见的选项卡上正常呈现。它需要计算高度/宽度(即使你指定它们)...如你所见。

Yeah, that's a big problem with the grid. If you use it declaritively in a tab container, it won't render properly on the non-visible tabs. It needs to calculate height/width (even though you specify them)...as you have seen.

我遇到的方法是以编程方式创建网格标签选择。我在 dojo论坛上发布了关于我的解决方案。我的代码示例已在 github。上结束了。发布这里的信息有点太大了。让我知道,如果你想要,我会编辑我的答案。

The way I got around it was to create the grids programatically on tab select. I posted about my solution on the dojo forums. My code sample is over on github. It's a bit too large to post here methinks. Let me know if you want it, and i'll edit my answer.

还有一个讨论 nabble 使用不同的解决方案。

There's also a discussion on nabble with a different solution.

这篇关于Dojox.grid.DataGrid - 在窗口小部件中 - 仅在可见选项卡上呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆