Pinned Rows — Django-tables2 2.3.1 Documentation
Getting started
- Installation
- Tutorial
- Populating a table with data
Customization
- Alternative column data
- Alternative column ordering
- Column and row attributes
- Customizing headers and footers
- Swapping the position of columns
- Pagination
- Table Mixins
- Customizing table style
- Query string fields
- Controlling localization
- Class Based Generic Mixins
- Pinned rows
- Attributes for pinned rows
- Filtering data in your table
- Exporting table data
Reference
- API
- FAQ
- Upgrading and change log
- Glossary
- Pinned rows
- Edit on GitHub
This feature allows one to pin certain rows to the top or bottom of your table. Provide an implementation for one or two of these methods, returning an iterable (QuerySet, list of dicts, list objects) representing the pinned data:
get_top_pinned_data(self) - Displays the returned rows on top.
get_bottom_pinned_data(self) - Displays the returned rows at the bottom.
Pinned rows are not affected by sorting and pagination, they will be present on every page of the table, regardless of ordering. Values will be rendered just like you are used to for normal rows.
Example:
class Table(tables.Table): first_name = tables.Column() last_name = tables.Column() def get_top_pinned_data(self): return [ {"first_name": "Janet", "last_name": "Crossen"}, # key "last_name" is None here, so the default value will be rendered. {"first_name": "Trine", "last_name": None} ]Note
If you need very different rendering for the bottom pinned rows, chances are you actually want to use column footers: Adding column footers
Attributes for pinned rows¶
You can override the attributes used to render the <tr> tag of the pinned rows using: pinned_row_attrs. This works exactly like Row attributes.
Note
By default the <tr> tags for pinned rows will get the attribute class="pinned-row".
<tr class="odd pinned-row" ...> [...] </tr> <tr class="even pinned-row" ...> [...] </tr>Từ khóa » đan Row
-
Dan Row - Vice President Of Strategic Initiatives - PC Housing
-
Django-admin-row-actions - PyPI
-
DJANGO - How To Display Multiple Database Rows In One Row In View
-
Django Row-level Permissions - Gists · GitHub
-
Tan Django Coat - The Row - SSENSE
-
Performing Raw SQL Queries - Django Documentation
-
The Row Longline Django Coat £2290 - Harrods
-
Men's Django Coat In Nylon In | The Row
-
Beige Django Padded Shell Trench Coat | THE ROW - MR PORTER
-
Dan Row (@glassguy2020) • Instagram Photos And Videos
-
Dan Row | Facebook
-
Using Postgres Row-Level Security In Python And Django - Pganalyze