Allow passing arbitrary attrs when rendering grid
This commit is contained in:
parent
e2bfb31cb2
commit
91b395118e
|
@ -375,6 +375,7 @@ class Grid(object):
|
||||||
elif self.width == 'half':
|
elif self.width == 'half':
|
||||||
grid_class = 'half'
|
grid_class = 'half'
|
||||||
context['grid_class'] = '{} {}'.format(grid_class, context.get('grid_class', ''))
|
context['grid_class'] = '{} {}'.format(grid_class, context.get('grid_class', ''))
|
||||||
|
context.setdefault('grid_attrs', {})
|
||||||
return render(template, context)
|
return render(template, context)
|
||||||
|
|
||||||
def get_default_filters(self):
|
def get_default_filters(self):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
## -*- coding: utf-8; -*-
|
## -*- coding: utf-8; -*-
|
||||||
<div class="grid ${grid_class}">
|
<div class="grid ${grid_class}" ${h.HTML.render_attrs(grid_attrs)}>
|
||||||
<table>
|
<table>
|
||||||
${grid.make_webhelpers_grid()}
|
${grid.make_webhelpers_grid()}
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in a new issue