starcitizentools/ag-grid
最新稳定版本:v0.3.0
Composer 安装命令:
composer require starcitizentools/ag-grid
包简介
Renders AG Grid data grids in MediaWiki
README 文档
README
Build sortable, filterable AG Grid data tables on wiki pages, straight from Lua. Put clickable links and thumbnails inside cells, page through large datasets, and query rows from Semantic MediaWiki or Bucket.
✨ Highlights
- Interactive tables on wiki pages — readers sort, filter, search, and page through the data in place, instead of scrolling a static wikitable.
- Scales to large datasets — page through thousands of rows, or query them on the server so the page stays light.
- Shows your structured data — turn Semantic MediaWiki or Bucket data into a live table, sorted, filtered, and paged on the server.
- Rich cells — clickable page links and thumbnails inside cells, resolved server-side.
- Authored in Lua — define grids in a Scribunto module; no hand-built HTML or JavaScript.
- Fits your wiki — matches the active skin's light/dark colours automatically, and extends from JavaScript when you need a custom renderer or filter.
📋 Requirements
- MediaWiki 1.43 or later
- Scribunto
📦 Installation
-
Drop the extension in
extensions/AGGridand load it fromLocalSettings.php:wfLoadExtension( 'AGGrid' );
-
Run the database updater to create the extension's tables (
aggrid_data,aggrid_source):php maintenance/run.php update
Grids will not render until these tables exist.
⚙️ Configuration
All settings are optional.
| Setting | Default | Description |
|---|---|---|
$wgAGGridBackendCacheMaxAge |
600 |
Max-age (seconds) for backend-source grid REST responses (the row pages and column values). Higher cuts backend load but is a hard staleness ceiling — there's no purge when the underlying data changes. |
$wgAGGridBucketMaxValues |
1000 |
Maximum rows scanned when listing a Bucket column's set-filter values; the list is marked partial when reached. |
🚀 Quick start
Pass a gridOptions table to render:
mw.ext.aggrid.render{ columnDefs = { { field = 'name', headerName = 'Name' }, { field = 'price', headerName = 'Price', filter = 'agNumberColumnFilter' }, }, rowData = { { name = 'Aurora', price = 25 }, { name = 'Mustang', price = 30 }, }, pagination = true, }
gridOptions mirrors AG Grid's
gridOptions object one to one, so
anything JSON-serialisable from their docs works here. See
Authoring grids for the full picture.
🔀 Two ways to supply data
- Inline — supply
columnDefsandrowDatadirectly, as above. Best for small, hand-written or Lua-generated tables. → Authoring grids - Backend source — supply a
sourcedescriptor and the rows come from Semantic MediaWiki or Bucket, queried and paged on the server. Best for large or already-stored datasets. → Backend source grids
📚 Documentation
| Guide | What it covers |
|---|---|
| Authoring grids | The inline gridOptions model, the no-functions limit, pagination, theming, limits |
| Rich cells | Links, thumbnails, linked thumbnails, and link lists |
| Formatting | format specs for numbers and dates |
| Filters | The aggridSet set filter and the quick-search box |
| Backend source grids | Querying rows from Semantic MediaWiki and Bucket |
| Extending with JavaScript | Custom column types, renderers, filters, and the grid API |
🔎 See also
⚖️ License
GPL-3.0-or-later. Bundles AG Grid Community (MIT); see modules/lib/ag-grid-community/LICENSE.txt.
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2026-06-03