View Full Version : create a timer in grid panel column\ update row style based on timer

26 Aug 2013, 9:26 AM

I am creating a realtime application. I have a grid in which there is a column to show countdown.Before countdown ends user has to accept request.

Problem: I could not find a way to update my countdown timer column in grid for all the rows. I have tried updating value of columnin store ,but it turns out to be very slow .Futher if timer value reaches 5 min then color of row in grid should change.

Is there any event or method in grid panel where I could write logic to update column value and keep on checking if values meets a criteria.


Gary Schlosberg
4 Sep 2013, 6:41 AM
I don't know of a built-in functionality like that. If you post code for people to fiddle with, solutions have a way of coming to the surface.

4 Sep 2013, 7:48 AM
As I remember, if you all your columns have dataIndex and you don't use any 'summary'-features, then grid updates only one cell on record update. Plus it changes row attributes - without replacing it. This should be done relatively fast.
However, if you have some kind of 'shrink-wrap' in your grid layout, then after each update it will run relayout - up to the container with fixed dimensions. If you ultimately need such layout, I advise to suspendEvents() on your store before time update, then resumeEvents() and fireEvent('refresh', store).