Question

I am new to TurboGears2 and by extension ToscaWidgets2. I am following the tutorial given here http://turbogears.readthedocs.org/en/latest/cookbook/datagrid.html

for creating a basic datagrid. When I view the index page, all I see is this:

class 'tw2.core.params.DataGrid_s_s'

I have also tried using a DataGrid for showing data from an existing DB, but I also get the same above result. Shouldn't there be a .css file that would handle the grid generation/display?

I have checked past tutorials for using DataGrid on TurboGears, and when it comes to displaying the grid, they only show this line:

${grid(value=data} ( or ${grid(data)} in older TG versions).

Since there are no errors being shown, I am at a complete loss here. I have searched online for a solution on this, but I haven't been lucky. Any advice on how to get around this?

Cheers, DM

Was it helpful?

Solution

It changed in recent ToscaWidgets versions, when you want to display a widget (like the DataGrid) you should prefer an explicit call to the display method instead of calling the widget itself.

try to replace ${grid(value=data} with ${grid.display(value=data}

Have a look at the Forms tutorial, it covers some basics on working with forms and TW2 widgets, the DataGrid in the ends it's just a Widget so behaves like forms for some features.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top