On Sat, Oct 05, 2013 at 11:25:56PM +1000, Craig Small wrote:
> Why this is important is that with jqGrid the TableBase makes the jqGrid
> widget and it has a url to query the JSON backend (which is defined by
> the TableFiller) so I need either TableBase or the Widget to be aware of
> this variable.

To answer my own question. :)
You cannot put it into the TableBase because this is called once. So if
you go to admin/attributes/?h=2 and then admin/attributes/?h=4 then
the h=2 stays there until the server is reset.

Can't use mount_point because it gets confused. So having things like
w.display(action=mount_point+'.json') 
doesn't wor.

Can't use tg.request.url because when you add the json at the end you
get things like admin/attributes?h=2.json

Probably a few things work, but for me:
In my TableBase have a propery method for url that uses
tg.request.path_url
Then in the controller passing gridata which takes the values I want to
pass to the grid and then the template also passes this along
w.display(griddata=griddata)
Then in the widget's init function set options['griddata'] to that
griddata value.

Works fine for single grids on a screen. Haven't worked out how to do
it cleanly for multiple grids.

 - Craig
-- 
Craig Small VK2XLZ   http://enc.com.au/          csmall at : enc.com.au
Debian GNU/Linux     http://www.debian.org/      csmall at : debian.org
GPG fingerprint:     5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5

-- 
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/groups/opt_out.

Reply via email to