Render row selection controls server-side in SelectionTable for improved usability
This commit is contained in:
@@ -58,6 +58,14 @@ class SelectionTable(tables.Table):
|
||||
# Defensive: don't break table rendering if introspection fails
|
||||
pass
|
||||
|
||||
# By default render the row selection controls above the table so
|
||||
# templates don't need to include `{{ table.row_selection_controls }}`.
|
||||
try:
|
||||
# `row_selection_controls` is already marked safe HTML.
|
||||
self.caption = self.row_selection_controls
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
@property
|
||||
def row_selection_controls(self):
|
||||
"""Return HTML for the row-selection control bar.
|
||||
|
||||
Reference in New Issue
Block a user