On Tue, May 07, 2013 at 01:27:06AM +0200, Alessandro Molina wrote:
>    The tablefiller gets the data through the _do_get_provider_count_and_objs
>    using self.__provider__.query to actually retrieve it. 
>    You can provide your own tablefiller with
>    custom _do_get_provider_count_and_objs if you want to change the returned
>    data.
It's a little more than that, I've got it working with a few caveats.
OK, so the TableBase is pretty much what you'd expect, it looks a lot
like the sprox.dojo one with a different widget.

TableFiller does need do_get_provider_count_and_objs changed, mainly
because the **kw received by the widget is different. dojo seems to
use limit and offset while jqGrid uses page and rows for the same thing
and the sorting is done differently.

get_value in TableFiller needs adjusting because the JSON data expected
is also different. I strongly suspect the dojo one doesn't work as I got
errors on it.

The previous change means the get_all.mak template breaks because its
expecting certain fields which no longer appear in that format. Also the
paginate stuff doesn't make sense when the jqGrid does it. I could of
put this change in the controller instrea but it seemed better fit
there.

What's left?
  Sorting = basicaly ran out of time. I already do it for a normal out
  of the CRC grid so I'll nick that bit of code.

The big issue I cannot solve cleanly is the linkage between TableBase TO
TableFiller for the field order.  The standard grid returns rows in a
dictionary so order doesn't matter. jqGrid expects a list, so its
important that the list TableFiller sends via JSON is the same order
of the widget TableBase creates.

I think using self.__fields__ does it but it will need more testing.
I basically need TableBase to tell TableFiller "my widget expects these
fields in this order"

A side-effect is I haven't worked out how to nicely omit the id column
as jqGrid needs to see it in its row dictionary. That's minor but
annoying.

The code is sitting at
https://github.com/csmall/rnms/blob/master/rnms/lib/table.py

 - 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to