如何强制GWT小部件进行更新

如何强制GWT小部件进行更新

本文介绍了如何强制GWT小部件进行更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有GWT小部件(FlexTable).当我将其上的某些行设置为false时,它将不会更新.如何强制更新?

I have GWT widget(FlexTable) on my page. When I set some rows on it to visible false, it will be not updated. How can I force it to update?

推荐答案

GWT通过将"display:none"作为内联样式添加到元素(表行或其他任何元素)来隐藏.查看呈现的HTML,看看是否应用了此样式,如果未粘贴mabn指出的代码,则查看.

GWT hides by adding "display:none" as inline style to the element be it table row or anything else. Look in the rendered HTML and see if this style is applied, if not paste the code as mabn pointed out.

如果没有发生隐藏,通常的原因是在Flextable上的刷新/更新还必须调用其他代码,以重新渲染/重新显示隐藏的行.由于回调的异步性质,服务回调通常会执行此操作,因此回调中的代码通常会在一个表中呈现出完整的数据,而这往往出乎意料.

If hiding does not happen, the usual reason is there must be some other piece of code that is invoked by your refresh/update on the Flextable that re-renders back / re-displays the hidden rows. Service callbacks often do this, due to the asynchronous nature of the callback, code in the callback that usually renders a table full of data, often does so unexpectedly.

搜索填充表的代码(通常在回调内部),并在隐藏某些行后检查是否调用了该表.

Search for the code that populates your table (this is usually inside a callback) and check if it's invoked after you have hidden some rows.

这篇关于如何强制GWT小部件进行更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 08:47