Static createCreates the model of a cover grid.
the items, one per tile (the renderer gets the item as cellValue)
draws one tile into the cell <div>
width of a tile in px (default 200) – change it later via bodyModel.coverWidth + repaintHard()
height of a tile in px (default 300)
initial width of the grid; the table sets the width of its host on start and after a resize
extra height of the first row in px (room above the first tiles, e.g. for a toolbar)
the table model; tableModel.bodyModel holds items, filteredItems, coverWidth, coverHeight
declare const renderer: CellRendererIf;
const gridModel = CoverGridFactory.createCoverGridModel(["a.jpg", "b.jpg", "c.jpg"], renderer, 120, 180);
// bigger tiles – no new model:
gridModel.bodyModel.coverWidth = 200;
gridModel.bodyModel.coverHeight = 300;
tableApi.repaintHard();
Static createOptions for a cover grid: no borders and separators, no row or column hover, header and footer height 0, and the
scroll position restored under the key of getStorageKeyFn (localStorage). (The name has a typo – kept for
compatibility.)
the height of a tile (coverHeight)
storage key of the scroll position (default "CoverGrid")
new options – add your own fields with a spread
let photoFilter = "";
const gridOptions: TableOptionsIf = {
...CoverGridFactory.createCoverGrisDefaultOptions(240, () => "photos"),
externalFilterFunction: (photo: { name: string }) => photo.name.includes(photoFilter),
shortcutActionsDisabled: true
};
Creates cover grids: a flat array of items shown as tiles (book covers, photos, products) – as many per row as fit into the width of the table (
floor(width / coverWidth)), without header and footer. Only the visible rows are rendered, like in every GuiExpert Table; filter (externalFilterFunction),sort()and the scroll position work as usual. Guide: instructions.md 5.10, showcase https://gui.expert/showcase/covergrid/run.Example