- project is called newwidget.  I zipped up everything.
The grid2.py must be copied to the widget directory.
http://www.alvinwang.com/newwidget.zip


Sample config -
config_array= [
{'header':'name',
    'header_link':{'href':'','CLASS':'whatever', 'title':'name of
field'},
     'field': 'name',
     'field_link': { 'href':'http://www.yahoo.com','CLASS':'whatever',
'title':'just a tooltip'},
     'field_url': 'description',
     'text': ''
},
        {'header':'Description',
        'field_link': {},
          'header_link':{},
          'field': 'description',
             'text': ''
       },
        {'header':'Static Text',
          'header_link':{},
        'field_link': { 'href':'http://www.turbogears.org'},
        'field': '' ,
         'text': 'Just some Text'
        }
]

What it does
If no column configs, it will just display data.  One field per column

Takes a list of column configs.  In this case 3, reassembles the data.
Adds links, tooltips, etc.  Basically, I use the py:attrs to allow you
to add any parameter you feel like.

Bugs
It errors when I leave out parameters.  I thought the py:if's could
handle it.

How could I do this better?

Ajax Version
I am not really clear on how kid output gets converted to JSON.  I was
thinking that a pagin grid with Ajax would be interesting next step.
Thanks
Alvin

Reply via email to