View Full Version : Editor Grid Panel cell Templating based on update time

30 Sep 2010, 8:16 AM
Hello there...
I have a specific scenario where i have to colour my cells in my editorgridpanel based on update time...
I am aware that i can define how each cell can have a template by using renderer and metaData.css...
The problem is how to tackle the update time...
My store is restful, with a jsonreader and writer, a proxy is configured, and the Record i use has the fields of the columns of the grid.
When a cell is updated in less than 1 minute, it's red, between 1 and 2 minutes it's black and then it greys out.

Any ideas? I thought of using complex structured, but my record cannot cope with it. i.e
i believe i can't use this:
Ext.data.Record.create(['Id','RegionId', {'Town', 'UpdateTime'}, {'Rate', 'UpdateTime'}, {'Xyx', 'UpdateTime'}])

So essentially, i want to find a way to provide "updatetime" for EACH cell, and a function that assigns a css style to the cells based on theis update time.

A solution i have thought but not sure if it's the best, is have a store for the (cell)values and a store to have the (cell) update times, and link them together in a way...

p.s cell values and update times are persisted in my database, since when i first load the grid i still want to view the kind of cell templating i descibed above

Any suggestions would be appreciated