Hi Craig,
On Feb 21, 3:56 am, Craig Small <[email protected]> wrote:
> The first is auto-updates. This table the grid uses for data is updated
> in the backend so I'd like to be able to display the last n'th items
> and update this every x seconds with the latest n'th. I've done this
> previous with a html table and a javascript refresh which redraws the
> entire page.
What widget are you using specifically?
tw2.jqplugins.jqgrid.jqGridWidget or
tw2.jqplugins.jqgrid.SQLAjqGridWidget ?
> Secondly, is there a way of apply a class to a cell or row based upon
> a database item?
>
> Again, its working with a html table with:
> <tr class="rowtype${thing.type_id}" ...etc
> I then have a CSS file with rowtype1 rowtype2, rowtype3, etc
> This is done because each row needs to be a certain colour based upon
> type_id so all type_id==2 are blue etc
> Is this possible with jqgrid? If so how?
The widget was not intended for this. You can try modifying the CSS
yourself once you have run the tw2 resource archiver (see below).
> Finally, because I just remembered, is there a way of caching that CSS
> file I generate? At the moment, each call to the database regenerates
> the CSS document, which means an entire scan of the thing_type database
> to pull out id,bgcolor and fgcolor. The table doesn't change much so
> to me if I could cache it it would be better.
Yes. There is a distutils command that tw2 provides called
archive_tw2_resources. Try running:
$ python setup.py archive_tw2_resources --help
$ python setup.py archive_tw2_resources --force --output=/tmp/
my_resources --distributions=myapp
You'll then need to copy the contents of the /tmp/my_resources folder
into the public/ folder of your tg2 app.
Finally, turn off tw2 resource serving adding the following config to
the bottom of myapp/config/app_cfg.py
base_config.custom_tw2_config['serve_resources'] = False
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.