Closed spapas closed 3 years ago
Why don't you override a shifter_template
attr from ColumnShiftTable?
This attribute finally override template_name
attr from origin Table class.
class ColumnShiftTable(tables.Table):
....
shifter_template = "django_tables2_column_shifter/table.html"
....
def __init__(self, *args, **kwargs):
....
if hasattr(self, "template_name"):
self.template_name = self.shifter_template
else:
self.template = self.shifter_template
....
You can create your own template for shifter and override shifter_template
attribute in ColumnShiftTable class.
Your custom template can also inherit from django-tables2-column-shifter.templates.tables
for example
Custom Templase:
{% extends "django_tables2_column_shifter/bootstrap4.html" %}
I'll try it thank you!
A django-tables2 package has the template_name option to choose the template used:
For example something like
The problem is that when my table inherits from
ColumnShiftTable
(instead ofTable
) this attribute is completely ignored. Whould it be possible somehow to respect that parameter? I understand that it may not be possible because the template must follow a particular layout in order to be compatible with django-tables2-column-shifter.Thank you