I have a pylons web-page with a table. I have created python functions in the template which help with the construction of the table html. One of these functions takes an 'item' and generates an html row while also adding css zebra striping. The other def generates the header row's html.
This works perfectly for loading the initial table using the context variable 'items'. However, when I try to update the table via ajax, I pull new table contents off the server in json format. My 'items' are then javascript objects in a javascript array. I can no longer use the pylons 'getHeaderHtml()' and 'getRowHtml(item)'. So the handling of my zebra striping as well as the formatting of the html must be duplicated? There has to be a better way, right?
Thanks!