Reusable AG Grid integration for Django with HTMX-safe lifecycle and persisted grid preferences
Project description
Django Grid Table
Reusable Django app for AG Grid integrations with HTMX-safe lifecycle handling, saved searches, column presets, server-side grid preferences, and optional UI plugins.
Install:
pip install django-grid-table
Local editable install:
pip install -e ~/Projects/django-grid-table
With uv, keep the normal PyPI dependency and override it locally:
[project]
dependencies = [
"django-grid-table>=0.1.0",
]
[tool.uv.sources]
django-grid-table = { path = "../django-grid-table", editable = true }
Django Setup
INSTALLED_APPS = [
# ...
"django_grid_table",
]
from django.urls import include, path
urlpatterns = [
path("", include("django_grid_table.urls")),
]
python manage.py migrate django_grid_table
Template Usage
Load AG Grid and Sortable once in the base template, outside HTMX-swapped content:
<script src="https://cdn.jsdelivr.net/npm/ag-grid-community@31.3.2/dist/ag-grid-community.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js"></script>
Use the bundled tag:
{% load django_grid_table %}
<div id="products-grid" class="ag-theme-quartz-dark"></div>
<script>
window.ProductsGrid = {
columnDefs: ProductColumns,
rowModelType: "infinite",
cacheBlockSize: 200,
context: { gridId: "products" },
};
</script>
{% django_grid_table_scripts grid_id="products" options_var="ProductsGrid" container_id="products-grid" %}
Or include partials directly:
{% include "django_grid_table/search_bar.html" with grid_id="products" %}
{% include "django_grid_table/modal.html" with grid_id="products" %}
{% include "django_grid_table/scripts.html" with grid_id="products" container_id="products-grid" options_var="ProductsGrid" %}
Optional plugins:
{% include "django_grid_table/plugins/smart_filter.html" %}
{% include "django_grid_table/plugins/advanced_search.html" %}
{% include "django_grid_table/plugins/custom_tooltip.html" %}
Runtime Rules
Do not load AG Grid CDN scripts inside HTMX-swapped fragments.
For AG Grid infinite row model, do not use quickFilterText or autoHeight.
Use manager._searchText and backend filtering instead.
Always populate columnDefs before django_grid_table/scripts.html initializes
the grid.
Development
uv sync --extra dev
uv run ruff check .
uv run pytest
uv build
uv run --with twine twine check dist/*
Release
Publishing uses GitHub Actions trusted publishing. Configure the PyPI project
django-grid-table to trust the repository environment named pypi, then push
a version tag:
git tag v0.1.0
git push origin v0.1.0
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_grid_table-0.1.0.tar.gz.
File metadata
- Download URL: django_grid_table-0.1.0.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54bea4ebe47cb3d9c90da005d72f300bcb2e0c0a5849a05b98461a5b9ab96817
|
|
| MD5 |
74cdc25797c00a712c64cb499714e59d
|
|
| BLAKE2b-256 |
1bd5450f043787b3afa744abbd27938fc8efb4a2182e7eb71f82e1fb21b99cb8
|
Provenance
The following attestation bundles were made for django_grid_table-0.1.0.tar.gz:
Publisher:
ci.yml on alpiua/django-grid-table
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_grid_table-0.1.0.tar.gz -
Subject digest:
54bea4ebe47cb3d9c90da005d72f300bcb2e0c0a5849a05b98461a5b9ab96817 - Sigstore transparency entry: 1672123242
- Sigstore integration time:
-
Permalink:
alpiua/django-grid-table@7917a457807bbe23ccffdbada8f6dbc750562334 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/alpiua
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@7917a457807bbe23ccffdbada8f6dbc750562334 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_grid_table-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_grid_table-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29372c58a586c42400e47e8b11b7e359badccc3c083bf14963c9e89cd879a5f4
|
|
| MD5 |
0d3c0e20e409ca0fd9d8f918c109f77f
|
|
| BLAKE2b-256 |
bd0e5a5c90e5ae3773c91e94cf5c558fd0e6ce60f95777bf4b03ad8b2b55c589
|
Provenance
The following attestation bundles were made for django_grid_table-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on alpiua/django-grid-table
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_grid_table-0.1.0-py3-none-any.whl -
Subject digest:
29372c58a586c42400e47e8b11b7e359badccc3c083bf14963c9e89cd879a5f4 - Sigstore transparency entry: 1672123265
- Sigstore integration time:
-
Permalink:
alpiua/django-grid-table@7917a457807bbe23ccffdbada8f6dbc750562334 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/alpiua
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@7917a457807bbe23ccffdbada8f6dbc750562334 -
Trigger Event:
push
-
Statement type: