@libregrid/rich-select
v1.3.5
Published
Rich Select editor for AG Grid Community — part of LibreGrid
Readme
@libregrid/rich-select
Edit a cell by choosing from a searchable, virtualized list. Configure the allowed values, typing behavior, and match highlighting for fields such as status, category, or country.
Documentation and examples · Angular Material editor
Install
npm install "ag-grid-community@^36.2.0" @libregrid/rich-selectRequires ag-grid-community >=36.1.0 <37 as a peer dependency.
Usage
In a browser TypeScript project, add a grid container before running the code:
<div id="grid" style="height: 400px"></div>Set a column's cellEditor to 'agRichSelectCellEditor':
import { ModuleRegistry, AllCommunityModule, createGrid } from 'ag-grid-community';
import { RichSelectModule } from '@libregrid/rich-select';
ModuleRegistry.registerModules([AllCommunityModule, RichSelectModule]);
createGrid(document.querySelector<HTMLElement>('#grid')!, {
columnDefs: [
{ field: 'country' },
{
field: 'status',
editable: true,
cellEditor: 'agRichSelectCellEditor',
cellEditorParams: {
values: ['Draft', 'Published', 'Review'],
allowTyping: true,
filterList: true,
searchType: 'matchAny',
highlightMatch: true,
},
},
],
rowData: [{ country: 'United Kingdom', status: 'Draft' }],
});Double-click (or press Enter on) a cell to open the editor. Type to filter. Press Enter to commit. The list renders a visible window of options rather than the entire set.
API
| Export | Purpose |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| RichSelectModule | Registers the editor under the component name agRichSelectCellEditor (moduleName: 'RichSelect'). |
| RichSelectCellEditor | The editor component — extend it for a themed variant, as @libregrid/material's MaterialRichSelectCellEditor does. |
Learn more
- LibreGrid README — full package list and quick start
@libregrid/material— Material-styled variant
Angular
Use the same column definitions and grid options with ag-grid-angular.
Register the modules shown above through provideLibreGrid from
@libregrid/angular. See the
Angular setup for a complete component and bootstrap example.
License
MIT — see LICENSE and NOTICE. LibreGrid is an independent project and is not affiliated with, endorsed by, or sponsored by AG Grid Ltd.
