Always add key as class to grid column headers; allow literal label
This commit is contained in:
parent
c8b8608dc7
commit
d727efa6a0
|
@ -184,7 +184,11 @@ class AlchemyGrid(Grid):
|
|||
Returns an iterator for all currently-visible columns.
|
||||
"""
|
||||
for field in self._fa_grid.render_fields.itervalues():
|
||||
column = GridColumn(field.key, label=field.label(),
|
||||
if getattr(field, 'label_literal', False):
|
||||
label = field.label_text
|
||||
else:
|
||||
label = field.label()
|
||||
column = GridColumn(field.key, label=label,
|
||||
title=getattr(field, '_column_header_title', None))
|
||||
column.field = field
|
||||
yield column
|
||||
|
|
|
@ -588,6 +588,7 @@ class Grid(object):
|
|||
kwargs['c'] = tags.link_to(column.label, '#', title=column.title)
|
||||
elif column.title:
|
||||
kwargs['c'] = HTML.tag('span', title=column.title, c=column.label)
|
||||
kwargs['class_'] = '{} {}'.format(kwargs.get('class_', ''), column.key)
|
||||
return HTML.tag('th', **kwargs)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in a new issue