On Nov 13, 2006, at 4:28 PM, Paulo Leonardo wrote:
> > Hi, i have attemped work two AjaxGrid in the same page, but not > success. Where has erro? ajaxgrid work with multiple instances? > Example > code > > ---------- Controllers.py ---------- > ....... > grid = AjaxGrid(refresh_url="/search") > gridone = AjaxGrid(refresh_url="/searchgo") > > class Root(controllers.RootController): > @expose(template=".templates.form") > def index(self): > ... my code here... > return dict(form=grid, form1=gridone) > > @expose(format="json") > def search(self): > ... my code here... > > @expose(format="json") > def searchgo(self): > ... my code here... > > ---------- form.kid ---------- > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <?python import sitetemplate ?> > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:py="http://purl.org/kid/ns#" py:extends="sitetemplate"> > <head> > <meta content="text/html; charset=UTF-8" http-equiv="content-type" > py:replace="''"/> > <title>Ajaxgrid Example</title> > </head> > <body> > <span py:content="form.display()"></span> > <span py:content="form1.display()"></span> > > </body> > </html> > ---------- ---------- ---------- > > the problem is: only ajaxgrid is showed in the page. But i need two > ajaxgrid in the page. My code is incorrectly? Thanks :) You're probably getting DOM id collisions there so the JS code that generates the grid breaks. Try naming the grids to see what happens: grid = AjaxGrid("grid", refresh_url="/search") gridone = AjaxGrid("gridone", refresh_url="/searchgo") HTH, Alberto --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

