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. You can also set data directly in JavaScript.


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>.

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:requestpagechange-event, translations loaded from i18n-attribute, with lang="da". Also dispatching the dg:loading:start and dg:loading:end events.



Example: Created from JavaScript with document.createElement('data-grid'), with custom i18n and formatters-objects, and page set to 2 (beginning from 0) and nosortable.