Tuesday, November 2, 2010

Re: Reload CellTable data

On 2 nov, 17:07, Geoffrey De Smet <ge0ffrey.s...@gmail.com> wrote:
> I 'd like to add a button to reload the CellTable when it's pushed,
> but I can only find:
> - cellTable.redraw(); // Doesn't reload the data from the backend
> - simplePager.firstPage(); // I don't want it to change the page
>
> Is there an easy way to do something like cellTable.reload() or
> cellTable.refresh() ?

Maybe:
cellTable.setVisibleRangeAndClearData(cellTable.getVisibleRange(),
true);

http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/user/cellview/client/AbstractHasData.html#setVisibleRangeAndClearData(com.google.gwt.view.client.Range,
boolean)

But I think the expected use is to do it in your "model" rather than
the "view" (CellTable), where the "model" (or presenter, or whatever)
will fetch the data from the backend (maybe using getVisibleRange() to
filter it) and call setRowData() on the CellTable to update it.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment