I’d like to add multiple ‘items’ to the same cell using tables.LinkColumn.
Something like this:
column_name = tables.LinkColumn('some_url_edit', args=[A('pk')], attrs={'class':'tbl_icon edit'})
column_name += tables.LinkColumn('some_url_del', args=[A('pk')], attrs={'class':'tbl_icon delete'})
column_name += ...
Is this even possible? or should I create my own table view, without django-tables.
Thanks!
You have two options here, either use a
TemplateColumn, or write arender_FOOmethod.Here is an example using the
TemplateColumn(as you can see the record is added to the context that is used to render the template, thus allowing you to access thepkviarecord.pk:Example using the
render_FOO:As you can see the
TemplateColumnapproach is probably a little cleaner inyour case.