I'm formatting the data for certain columns within each row by calling a function, and returning an XML element, which then displays HTML within that cell. Code bellow is just to give you an idea...
GRID: links=dict(orderMaster=[ lambda row:(_get_order_address(row)), ]) def _get_order_address(row): order=db(Order.id==row.id).select(cache=(cache.ram,60), cacheable=True, ).first() t = XML('<strong>Customer:</strong><br/>' + (order.shipFirstName.capitalize() + ' ' if order.shipFirstName else '') + (order.shipLastName.capitalize() + '<br/>' if order.shipLastName else '') + (order.shipAddress1 + '<br/>' if order.shipAddress1 else '') + (order.shipAddress2 + '<br/>' if order.shipAddress2 else '') + (order.shipCity + ' ' if order.shipCity else '') + (order.shipPC + ', ' if order.shipPC else '') + (order.shipProvince + '<br/>' if order.shipProvince else '') + (order.shipCountry + '<br/>' if order.shipCountry else '') ) return t On Saturday, September 21, 2013 2:43:34 PM UTC-4, ssuresh wrote: > > The problem is that my data does not display too well in a table grid. > Some of my columns are descriptions that do not fit well inside a grid. So > I want to display it in a more readable alternate formats. - Something like > > ------------------------------------ > *Title * > description ...... > > *date* > ------------------------------------------- > > I used sqlform.grid because i want to make use of its other features like > automatic add/del/edits and search/export functionalities. > > So do you have any suggestions for that? > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.