I have a column rendering for a grid which draws text in bold if certain data holds true. Now when this data changes, I want to call some method on the grid to make it re-render itself. Is there a way to do this?
Asked
Active
Viewed 1.7k times
15
-
1Does your grid not refresh automatically? Maybe something wrong with your data binding... – user123444555621 Oct 05 '11 at 18:34
1 Answers
21
It's as easy as
grid.getView().refresh();

user123444555621
- 148,182
- 27
- 114
- 126
-
2If the data is changing, the renderer should be getting called, which means you wouldn't have to do this. rFactor: how are you changing the data? – dmackerman Oct 05 '11 at 18:52
-
There are some cases such as the `isDisabled` of an item of `ActionColumn` that are NOT re-calculated automatically on model change. I had to use this solution to make the icon work. Thanks! – George Pligoropoulos Nov 25 '15 at 15:04
-
I had the requirement to refresh just one column. I used this to accomplish that. It was so fast that I didn't mind the other columns are refreshed as well. – Christiaan Westerbeek Dec 04 '15 at 09:20