Hi,
Before my main question, a newbie question: Where is the source for
javascript/widgets/etc when installing on OS X? Now for the main
problem... I am working to get some database rows to appear in an
AjaxGrid. I have successfully built and tested the sample project
given in the TurboGears Documentation; however, I am having problems
integrating the grid into my own application. When I click the link
that should bring up the grid, I get no table appearing, plus there is
an error in the console that "default() takes exactly 1 argument." In
addition, the Error Console within Firefox throws up an error that
"ajaxgrid_0_AjaxGrid id not defined".
My project is different from that of the sample in that I have
multiple controllers and I think that this may be the reason why
refresh_url is pointing to the wrong place. I have tried all logical
urls I can think of, but can't get the table to refresh. Any help
would be appreciated.
Thanks,
Shane
My controller structure looks like:
-Root.py(controllers.RootController) #Mainly Identity related
-BaseController(controllers.Controller) # For common control methods
|
|
----- AdminController(BaseController) # For admin group specific
control
...... Other stuff ....
------> TROUBLE ajax_grid = AjaxGrid(refresh_url="//
refreshTable") <----------
....
rows = []
# This control method is called through a link on the
admin page...
@expose(template="TankerManager.templates.ajax_dashboard")
def showAjaxTables(self):
log.debug("In showAjaxTables.")
return dict (ajax=ajax_grid)
@expose(format="json")
def refreshTable(self):
log.debug("In Admin/refreshTable.")
id = length(self.rows)
self.rows.append([id, "unit" + str(id), "Unit description + "
str(id)])
return dict(
headers = ["ID", "Name", "Description"],
rows = self.rows,
)
... More stuff ...
|
|
-- Other controllers (BaseController)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---