UI: Components

Data Grid

<data-grid> is a custom element, you can wrap around an existing <table>, or fill with data using the data-attribute. The latter can be either a stringified object or an endpoint.


Example with data from an endpoint set in data, and most features enabled, including debug, outputting rendering etc. to the console.


Event Playground

See the console



More examples


Wrapped around an existing <table>, with custom lang and i18n, set directly in HTML-attributes.

First NameLast NameKnown AsPlace
BruceWayneBatmanGotham City
ClarkKentSupermanMetropolis
TonyStarkIron ManMalibu
PeterParkerSpider-ManNew York City
MattMurdockDaredevilNew York City
SteveRogersCaptain AmericaWashington, D.C.
DianaPrinceWonder WomanThemyscira
ArthurCurryAquamanAtlantis
NatashaRomanoffBlack WidowMoscow
BarryAllenThe FlashCentral City
HalJordanGreen LanternCoast City
WandaMaximoffScarlet WitchTransia
BruceBannerHulkGamma Base
ScottLangAnt-ManSan Francisco
CarolDanversCaptain MarvelHarmony Grove
T'ChallaChallaBlack PantherWakanda


With data set as JSON directly in the data-attribute:



Example with data being fetched on a dg:pagechange-event, also setting and removing the loading-attribute.



Example: Created from JavaScript with document.createElement('data-grid'), with custom i18n and formatters-objects.