$ show contributte/datagrid
Contributte Datagrid is a mature, full-featured datagrid component for the Nette PHP framework. It provides a rich set of features including filtering, sorting, pagination, inline editing, tree view, CSV export, column hiding, group actions, and aggregation functions. The component is split into a PHP backend (Nette control) and a TypeScript frontend with a plugin-based architecture (Naja AJAX, Bootstrap 5, TomSelect, SortableJS). It abstracts data sources via the IDataSource interface, with implementations for arrays, Dibi, Nette Database, Doctrine ORM/Collections, Nextras ORM, Elasticsearch, and custom API endpoints. State persistence is pluggable through IStateStorage. The library is production-ready, actively maintained with a clear changelog and upgrade guides, but shows some technical debt with long methods, static properties, and deprecated methods. It is not a data research or analytics project; it is a reusable UI component for web applications.
The LLM identified 5 files worth highlighting for reuse:
Defines the contract for all data sources in the datagrid. Methods: filter(), sort(), limit(), getCount(), getData(). This is the core abstraction that makes the grid database-agnostic and reusable across projects. Can be extracted and implemented for any data backend.
Pluggable state storage interface with methods to save/restore grid state (page, sort, filter, etc.). Comes with SessionStateStorage and NoopStateStorage implementations. A clean, reusable pattern for persisting UI state in web applications.
Defines a function to compute aggregated values over a column (e.g., sum, average). Supports single-column and multiple-column variants. A reusable design pattern that can be applied to any tabular data aggregation requirement.
Exports a DatagridPlugin interface and a collection of plugin implementations (autosubmit, checkboxes, confirm, editable, inline, item-detail, treeView, and integrations with datepicker, nette-forms, selectpicker, sortable). Demonstrates a clean plugin pattern for extending frontend behavior without modifying core code.
A simple PHP trait that adds icon property (get/set) to any button or action class. Used across multiple components to avoid code duplication. A textbook example of trait usage for cross-cutting concerns in an object-oriented system.