On Sun, Aug 19, 2012 at 09:46:12PM -0700, jeetu wrote:
> I tried using colModel values but I am not able to get the total_sales
> visible.
>
> pager_options = {
> "colModel": [{ "name": "name"}, {"name":"total_sales"}],
> "colNames":["name", "total_sales"],
> }
>
> Or do I have to literally override the colModel?
Literally overriding it is what I had in mind. If you see
:meth:`_get_metadata` here:
http://bit.ly/QSrnEg It uses
:meth:`_make_model` across only the properties. If you override
cls.colModel with your own custom list of dicts, the widget would use
yours instead of building its own.
Alternatively, you could override :meth:`_get_properties` to return
all the properties plus a reference to "total_sales". Then the widget
should (hopefully) build its own colModel including your computed
column. See here for _get_properties ->
http://bit.ly/QSs8gA