Hello

Just getting started with TurboGears 2.3.2

I've worked through a few eamples online that I've found (movies, and 
'ideas' examples).

I'm having trouble getting SQLAjqGridWidget to do anything though.

I'm trying to construct a dynamic form with the widget in, my template 
looks like

<body>${widget.display()|n}</body>
The Forms class looks like
class myForm(tw2.forms.FormPage): title = 'My Form' class 
child(tw2.forms.TableForm): firstName = tw2.forms.TextField()
secondName = tw2.forms.TextField() outputgrid = StacksGrid()

And the StacksGrid class:

class StacksGrid(tw2.jqplugins.jqgrid.SQLAjqGridWidget): id = 
'grid_widget'entity = model.Imagesexcluded_columns = ['id']prmFilter = 
{'stringResult': True, 'searchOnEnter': False}pager_options = {'search': True, 
'refresh': True, 'add': False, }options = {'url': '/db_jqgrid/','rowNum': 
15,'rowList': [15, 30, 50],'viewrecords': True,'imgpath': 
'scripts/jqGrid/themes/green/images','width': 900,'height': 'auto',}def 
prepare(self):# This controller registration does not generally have to occur 
inside# 'prepare', but we place it here so we're sure the middleware has# been 
initialized by tw2.devtools.dev_server before we make demands of it.mw = 
tw2.core.core.request_local()['middleware']mw.controllers.register(self.__class__,
 'db_jqgrid')super(StacksGrid, self).prepare()

I get an output form of my two name fields and a 'Grid Widget' header, and 
a 'Save' button.
There are no rows in the grid, even though the table in model.Images has 
two rows. I can't see any sql being performed in the log for 'gearbox serve'

I'm sorry if this seems all too simple, I feel I'm missing something 
obvious but at the moment, I really can't see what it is and I'd appreciate 
any tips about what to check.

If I'm going to guess at something, I think I'd guess at the 'url' key in 
the grid widget options, and the controller registration. This is a sub 
controller so all my URLS are /mytest/something, so I launch my form with 
http://localhost:8080/mytest/myformtest
So do I need mytest/ prefixing the URL in these cases? (I tried, but it 
made no difference, maybe I did it wrong?)
Or of course, it could be something else!
Thanks to all :)

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to