定制 starcitizentools/ag-grid 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

starcitizentools/ag-grid

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

📦 Installation

  1. Drop the extension in extensions/AGGrid and load it from LocalSettings.php:

    wfLoadExtension( 'AGGrid' );
  2. 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 columnDefs and rowData directly, as above. Best for small, hand-written or Lua-generated tables. → Authoring grids
  • Backend source — supply a source descriptor 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.

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-06-03