AisTable

This component is for displaying tabular data. It supports pagination, filtering, sorting, custom rendering, various style options, events and asynchronous data.

Items (record data)

The items prop is an array of objects that is used to create the tbody rows of your AisTable. Example format:

const items = [
    { "id": 7032,"hawkId": "cyepiskov0", "univId": "00549444", "firstName": "Chancey", "lastName": "Yepiskov", "fullName": "Chancey Yepiskov", "email": "chancey-yepiskov@uiowa.edu", "hireDate": "05/09/1990", "retired": false,"inactive": true },
    { "id": 2701,"hawkId": "beyden1", "univId": "00120802", "firstName": "Beaufort", "lastName": "Eyden", "fullName": "Beaufort Eyden", "email": "beaufort-eyden@uiowa.edu", "hireDate": "06/05/1998", "retired": false,"inactive": false },
    { "id": 9380,"hawkId": "fstokey2", "univId": "00341804", "firstName": "Franky", "lastName": "Stokey", "fullName": "Franky Stokey", "email": "franky-stokey@uiowa.edu", "hireDate": "06/11/1993", "retired": false,"inactive": true },
    { "id": 8167,"hawkId": "mloisi3", "univId": "00769787", "firstName": "Maximilien", "lastName": "Loisi", "fullName": "Maximilien Loisi", "email": "maximilien-loisi@uiowa.edu", "hireDate": "01/02/1996", "retired": false,"inactive": false },
    { "id": 3167,"hawkId": "ckunkler4", "univId": "00580573", "firstName": "Cyrillus", "lastName": "Kunkler", "fullName": "Cyrillus Kunkler", "email": "cyrillus-kunkler@uiowa.edu", "hireDate": "06/30/1990", "retired": false,"inactive": false },
    { "id": 7137,"hawkId": "nroggerone5", "univId": "00815761", "firstName": "Noella", "lastName": "Roggerone", "fullName": "Noella Roggerone", "email": "noella-roggerone@uiowa.edu", "hireDate": "03/08/1990", "retired": false,"inactive": true },
    { "id": 7477,"hawkId": "tmcnamara6", "univId": "00198639", "firstName": "Tannie", "lastName": "McNamara", "fullName": "Tannie McNamara", "email": "tannie-mcnamara@uiowa.edu", "hireDate": "12/26/2000", "retired": true,"inactive": true },
    { "id": 8112,"hawkId": "csneesby7", "univId": "00846913", "firstName": "Cherlyn", "lastName": "Sneesby", "fullName": "Cherlyn Sneesby", "email": "cherlyn-sneesby@uiowa.edu", "hireDate": "09/20/2020", "retired": false,"inactive": false },
    { "id": 5702,"hawkId": "lcouves8", "univId": "00541147", "firstName": "Linnell", "lastName": "Couves", "fullName": "Linnell Couves", "email": "linnell-couves@uiowa.edu", "hireDate": "05/28/1997", "retired": false,"inactive": true },
    { "id": 8338,"hawkId": "gtinniswood9", "univId": "00053635", "firstName": "Gerrard", "lastName": "Tinniswood", "fullName": "Gerrard Tinniswood", "email": "gerrard-tinniswood@uiowa.edu", "hireDate": "11/25/2020", "retired": true,"inactive": true },
]
1
2
3
4
5
6
7
8
9
10
11
12

Fields (column definitions)

The fields prop is for specifying the table column headings, and in which order the columns of data are displayed. The field object keys are used to extract the value from each item (record) row, and to provide additional features such as enabling sorting on the column, etc. Example format:

const fields = [
    { key: 'id', label: 'Hawk ID', sortable: true },
    { key: 'hawkId', label: 'Hawk ID', sortable: true },
    { key: 'univId', label: 'Univ ID', sortable: true, class: 'text-center' },
    { key: 'firstName', label: 'First Name', sortable: true },
    { key: 'lastName', label: 'Last Name', sortable: true },
    { key: 'fullName', label: 'Full Name', sortable: true },
    { key: 'email', label: 'Email', sortable: true, class: 'whitespace-nowrap' },
    { key: 'hireDate', label: 'Hire Date', sortable: true, class: 'text-center whitespace-nowrap' },
    { key: 'retired', label: 'Retired', sortable: true, class: 'text-center' },
    { key: 'inactive', label: 'Inactive', sortable: true, class: 'text-center' },
]
1
2
3
4
5
6
7
8
9
10
11
12

Field definition reference

The following field properties are recognized:

Property
Type
Description
keyString
required  The key for selecting data from each object in the items array. See custom rendering to see more places that this field key is used.
labelString
Appears in the columns table header (and footer if foot-clone is set).
classString or Array
These classes will be added to all th and td tags, in the header, body, and footer, for that column.
sortableBoolean
Enable sorting on this column. Refer to the Sorting section for more details.
iconString or Object
Easily insert an icon into your thead or tfoot header. Supports string for core icons and Object for other FontAwesome Icons
formatterString or Function
A formatter callback function or name of a method in your component, can be used instead of (or in conjunction with) scoped field slots. The formatter will be called with the syntax formatter(value, key, item). Refer to Custom Data Rendering for more details.
sortByFormattedBoolean
Sort the column by the result of the field's formatter when set to true. Default is false. Boolean has no effect if the field does not have a formatter.
filterByFormattedBoolean
Filter the column by the result of the field's formatter when set to true. Default is false. Boolean has no effect if the field does not have a formatter.
tdClassString or Array or Function
These classes will be added to all td tags in the tbody for that column. If custom classes per cell are required, a callback function can be specified instead. The function will be called as tdClass(value, key, item) and it must return an Array or String.
thClassString or Array
These classes will be added to all th tags in the thead/tfoot for that column.
tdAttrObject or Function
JavaScript object representing additional attributes to apply to the tbody field td cell. If custom attributes per cell are required, a callback function can be specified instead. The function will be called as tdAttr(value, key, item) and it must return an Object.
sortFormatterString or Function
This functions the same as formatter, but is only used for sorting.
filterBoolean
Enable column filter on this column. Refer to Filtering section for more details
dateFilterBoolean
Enable date column filter on this column. Refer to Filtering section for more details

Basic Table

Basic table with default styling.

Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
cyepiskov000549444ChanceyYepiskovchancey-yepiskov@uiowa.edu05/09/1990
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998
fstokey200341804FrankyStokeyfranky-stokey@uiowa.edu06/11/1993
mloisi300769787MaximilienLoisimaximilien-loisi@uiowa.edu01/02/1996
ckunkler400580573CyrillusKunklercyrillus-kunkler@uiowa.edu06/30/1990

Styles

There are several props provided to alter the style of the table. Here are some of the basic styles:

Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
cyepiskov000549444ChanceyYepiskovchancey-yepiskov@uiowa.edu05/09/1990
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998
fstokey200341804FrankyStokeyfranky-stokey@uiowa.edu06/11/1993
mloisi300769787MaximilienLoisimaximilien-loisi@uiowa.edu01/02/1996
ckunkler400580573CyrillusKunklercyrillus-kunkler@uiowa.edu06/30/1990

Sorting

As mentioned in the Fields section above, you can make columns sortable. Clicking on a sortable column header will sort the column in ascending direction (smallest to largest), while clicking on it again will switch the direction of sorting to descending (largest to smallest). Clicking a third time will reset the sorting to the default sorting passed-in to the table. To sort by multiple fields, hold either the ctrl, shift or command key while selecting the fields to sort by. You can sort by as many fields as you would like.

The sort-by prop is what controls the initial, default sorting for the table. sort-by accepts an array of fields. The data will be sorted in the order the fields are listed in this array. To sort a field in a descending direction, place a - before the field name. In this example, sort-by=['lastName', '-firstName'], so the data will first be sorted ascending by lastName and then descending by firstName.

To manually execute this sorting, you would first click the lastName field, then press and hold the ctrl, shift or command key while clicking twice on the firstName field.

By default, null values sort last when sorting. Use the sort-nulls-first boolean prop to have null values show first.

Hawk ID
Univ ID
First Name
2
Last Name
1
Email
Hire Date
scooper301133454SteveCoopersteve-cooper@uiowa.edu01/09/2010
jcooper1100549444JohnCooperjohn-cooper@uiowa.edu05/09/1990
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998
ckunkler400580573CyrillusKunklercyrillus-kunkler@uiowa.edu06/30/1990
fstokey200341804FrankyStokeyfranky-stokey@uiowa.edu06/11/1993

Pagination

Table supports built in pagination of item data. You can control how many rows are displayed at a time by setting the per-page prop to the maximum number of rows you would like displayed. Use the current-page prop to specify which page to display (starting from page 1). You can use the AisPagination component in conjunction with this AisTable component for providing control over pagination.

Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
cyepiskov000549444ChanceyYepiskovchancey-yepiskov@uiowa.edu05/09/1990
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998
fstokey200341804FrankyStokeyfranky-stokey@uiowa.edu06/11/1993
mloisi300769787MaximilienLoisimaximilien-loisi@uiowa.edu01/02/1996
ckunkler400580573CyrillusKunklercyrillus-kunkler@uiowa.edu06/30/1990
nroggerone500815761NoellaRoggeronenoella-roggerone@uiowa.edu03/08/1990
tmcnamara600198639TannieMcNamaratannie-mcnamara@uiowa.edu12/26/2000
csneesby700846913CherlynSneesbycherlyn-sneesby@uiowa.edu09/20/2020
lcouves800541147LinnellCouveslinnell-couves@uiowa.edu05/28/1997
gtinniswood900053635GerrardTinniswoodgerrard-tinniswood@uiowa.edu11/25/2020

Sticky Headers

Use the sticky-header prop to enable a vertically scrolling table with headers that remain fixed (sticky) as the table body scrolls. By default, the headers will stick to the top (and footers to the bottom, if visible) of the page.

Use prop sticky-top to account for a fixed header. In this example, sticky-top="top-[57px]" is used to make the table headers stick at the bottom of the fixed application header (which has a height of 57px). The default is top-0 which results in the table headers sticking to the very top of the page.

For the footer, use prop sticky-bottom if you have to adjust for a fixed application/page footer. The default is bottom-0.

Stick to Page

Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
cyepiskov000549444ChanceyYepiskovchancey-yepiskov@uiowa.edu05/09/1990
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998
fstokey200341804FrankyStokeyfranky-stokey@uiowa.edu06/11/1993
mloisi300769787MaximilienLoisimaximilien-loisi@uiowa.edu01/02/1996
ckunkler400580573CyrillusKunklercyrillus-kunkler@uiowa.edu06/30/1990
nroggerone500815761NoellaRoggeronenoella-roggerone@uiowa.edu03/08/1990
tmcnamara600198639TannieMcNamaratannie-mcnamara@uiowa.edu12/26/2000
csneesby700846913CherlynSneesbycherlyn-sneesby@uiowa.edu09/20/2020
lcouves800541147LinnellCouveslinnell-couves@uiowa.edu05/28/1997
gtinniswood900053635GerrardTinniswoodgerrard-tinniswood@uiowa.edu11/25/2020
ceassona00934477CaraEassoncara-easson@uiowa.edu02/15/1997
dseczykb00403077DurSeczykdur-seczyk@uiowa.edu07/31/1996
bstalleyc00572461BevinStalleybevin-stalley@uiowa.edu11/17/1994
ebernhardssond00633707EvaleenBernhardssonevaleen-bernhardsson@uiowa.edu03/21/1990
mponcete00004601MichailPoncetmichail-poncet@uiowa.edu11/18/2019
mhartiganf00316331MacHartiganmac-hartigan@uiowa.edu03/01/1991
hpawelekg00214424HestherPawelekhesther-pawelek@uiowa.edu11/25/2002
atuteh00167917ArlanTutearlan-tute@uiowa.edu04/30/2018
jcornbilli00337376JoanaCornbilljoana-cornbill@uiowa.edu10/02/2001
mfeelyj00441189MeredithFeelymeredith-feely@uiowa.edu05/01/2019
gdowk00093302GabiDowgabi-dow@uiowa.edu08/19/2008
bandragl00180957BurlAndragburl-andrag@uiowa.edu04/06/1991
ewyndhamm00465889EmanuelWyndhamemanuel-wyndham@uiowa.edu04/15/2015
atschirschkyn00471829AlisaTschirschkyalisa-tschirschky@uiowa.edu04/06/1995
emarklino00111055EdinMarklinedin-marklin@uiowa.edu07/16/1993
pinottp00549245PortyInottporty-inott@uiowa.edu06/19/1991
hgawithq00752282HuntleyGawithhuntley-gawith@uiowa.edu01/05/2016
msellimanr00569992MikelSellimanmikel-selliman@uiowa.edu04/20/2020
mramsiers00679501MarilynRamsiermarilyn-ramsier@uiowa.edu03/22/2004
kheggisont00151064KenHeggisonken-heggison@uiowa.edu02/22/1993
ftodeou00355900FreddyTodeofreddy-todeo@uiowa.edu07/16/1991
wbaggotv00949758WellsBaggotwells-baggot@uiowa.edu02/06/2007
shaughw00587247SaschaHaughsascha-haugh@uiowa.edu03/26/1994
nluebbertx00846605NatalyaLuebbertnatalya-luebbert@uiowa.edu12/21/1993
cbelfragey00624156ChrysaBelfragechrysa-belfrage@uiowa.edu03/14/2009
rqualtroz00857855RuggieroQualtroruggiero-qualtro@uiowa.edu08/07/2004
fbird1000409574FrankBirdfrank-bird@uiowa.edu11/10/2015
mschachter1100166832MargerySchachtermargery-schachter@uiowa.edu05/26/1990
dlauderdale1200792283DennieLauderdaledennie-lauderdale@uiowa.edu02/24/1999
tscoates1300217643TresaScoatestresa-scoates@uiowa.edu02/21/2015
lbarmby1400782331LeonoraBarmbyleonora-barmby@uiowa.edu06/22/2018
jantonomoli1500403864JoseitoAntonomolijoseito-antonomoli@uiowa.edu03/14/2014
kkeyme1600164961KrissyKeymekrissy-keyme@uiowa.edu11/28/2001
hphilipot1700980816HamPhilipotham-philipot@uiowa.edu05/19/2007
mmattei1800615865MicaelaMatteimicaela-mattei@uiowa.edu01/14/2001
wstollenhof1900829399WellsStollenhofwells-stollenhof@uiowa.edu01/19/2005
pstainer1a00823585PatriziaStainerpatrizia-stainer@uiowa.edu09/23/1996
gscorey1b00166860GrayScoreygray-scorey@uiowa.edu03/31/1994
jkinghorn1c00579953JanettaKinghornjanetta-kinghorn@uiowa.edu12/31/1994
fmorfey1d00022499FlorinaMorfeyflorina-morfey@uiowa.edu04/10/2003
rcampbell1e00310438RodgeCampbellrodge-campbell@uiowa.edu12/21/2010
chaysey1f00691254CelindaHayseycelinda-haysey@uiowa.edu01/09/2003
vapplin1g00427255VivienneApplinvivienne-applin@uiowa.edu09/01/2008
mbernholt1h00471504MattheusBernholtmattheus-bernholt@uiowa.edu03/15/2005
norviss1i00323354NertiOrvissnerti-orviss@uiowa.edu12/14/2008
jbondar1j00184441JoshiaBondarjoshia-bondar@uiowa.edu10/02/2005
fravelus1k00521656FaydraRavelusfaydra-ravelus@uiowa.edu06/01/1998
wspratt1l00709251WynnSprattwynn-spratt@uiowa.edu11/28/2021
mcleaton1m00007808MyrtleCleatonmyrtle-cleaton@uiowa.edu07/24/1991
dknyvett1n00558039DaiseyKnyvettdaisey-knyvett@uiowa.edu09/25/1994
sdorrian1o00908864StafordDorrianstaford-dorrian@uiowa.edu11/18/2006
cle1p00843092CayeLe Sarrcaye-le sarr@uiowa.edu03/05/2015
nocaine1q00241332NorthO'Cainenorth-o'caine@uiowa.edu05/07/2018
jniese1r00093807JaninaNiesejanina-niese@uiowa.edu03/18/1997
lhawtry1s00676694LauraHawtrylaura-hawtry@uiowa.edu03/15/1994
iplumbe1t00219681IvePlumbeive-plumbe@uiowa.edu08/16/2015
fkeitch1u00327289FredericKeitchfrederic-keitch@uiowa.edu03/28/2015
elalor1v00638318ElisabettaLalorelisabetta-lalor@uiowa.edu04/07/1998
tpyson1w00464225TamasPysontamas-pyson@uiowa.edu06/15/2002
gokeefe1x00146544GretelO'Keefegretel-o'keefe@uiowa.edu01/22/2012
ndrinan1y00532978NeroDrinannero-drinan@uiowa.edu08/04/2017
csplain1z00966293CecillaSplaincecilla-splain@uiowa.edu04/21/2021
apuckett2000895741AbiePuckettabie-puckett@uiowa.edu05/23/2008
felmes2100395781FonzElmesfonz-elmes@uiowa.edu01/19/1991
mdeporte2200881930MilDeportemil-deporte@uiowa.edu04/05/1995
geastmead2300617432GrettaEastmeadgretta-eastmead@uiowa.edu10/13/1995
wpanas2400045500WayPanasway-panas@uiowa.edu08/09/2017
zbarling2500078128ZorinaBarlingzorina-barling@uiowa.edu08/16/1998
pbergstram2600375188PriceBergstramprice-bergstram@uiowa.edu11/27/2009
fteasdale2700927101FairTeasdalefair-teasdale@uiowa.edu03/03/1990
bholston2800181238BrockyHolstonbrocky-holston@uiowa.edu12/15/2018
ewalasik2900751738ErmannoWalasikermanno-walasik@uiowa.edu06/06/2004
pruxton2a00852703PabloRuxtonpablo-ruxton@uiowa.edu04/28/1991
jcopeman2b00819011JoeCopemanjoe-copeman@uiowa.edu07/24/2011
rmcshee2c00682567RobeniaMcSheerobenia-mcshee@uiowa.edu01/03/1996
adunkinson2d00817602AnnaleeDunkinsonannalee-dunkinson@uiowa.edu04/20/1993
scolquit2e00325842SigfridColquitsigfrid-colquit@uiowa.edu10/20/1992
gfrowen2f00289843GloriFrowenglori-frowen@uiowa.edu05/29/2013
rsannes2g00346699RebaSannesreba-sannes@uiowa.edu04/26/2017
cheeron2h00929705CoryHeeroncory-heeron@uiowa.edu03/14/2004
pkynoch2i00874844PaceKynochpace-kynoch@uiowa.edu07/11/2015
omarnane2j00776460OlvaMarnaneolva-marnane@uiowa.edu09/18/2003
lreiglar2k00533738LouieReiglarlouie-reiglar@uiowa.edu10/29/2018
yvigours2l00982156YorkerVigoursyorker-vigours@uiowa.edu06/20/2001
khails2m00467737KerrHailskerr-hails@uiowa.edu04/26/2016
lmcalpin2n00315938LillaMcAlpinlilla-mcalpin@uiowa.edu12/28/1994
amanagh2o00765071AllinaManaghallina-managh@uiowa.edu07/16/2016
snoddle2p00372596SkyeNoddleskye-noddle@uiowa.edu06/05/2016
vgirard2q00676910VereGirardvere-girard@uiowa.edu03/23/2016
diapico2r00566940DelmorIapicodelmor-iapico@uiowa.edu04/27/2006
Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date

Stick to Container

To set a maximum height on the table, wrap it in a container div with a max-height and overflow. The headers and footers will now stick to the top and bottom of the wrapping container, instead of the page.

Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
cyepiskov000549444ChanceyYepiskovchancey-yepiskov@uiowa.edu05/09/1990
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998
fstokey200341804FrankyStokeyfranky-stokey@uiowa.edu06/11/1993
mloisi300769787MaximilienLoisimaximilien-loisi@uiowa.edu01/02/1996
ckunkler400580573CyrillusKunklercyrillus-kunkler@uiowa.edu06/30/1990
nroggerone500815761NoellaRoggeronenoella-roggerone@uiowa.edu03/08/1990
tmcnamara600198639TannieMcNamaratannie-mcnamara@uiowa.edu12/26/2000
csneesby700846913CherlynSneesbycherlyn-sneesby@uiowa.edu09/20/2020
lcouves800541147LinnellCouveslinnell-couves@uiowa.edu05/28/1997
gtinniswood900053635GerrardTinniswoodgerrard-tinniswood@uiowa.edu11/25/2020
ceassona00934477CaraEassoncara-easson@uiowa.edu02/15/1997
dseczykb00403077DurSeczykdur-seczyk@uiowa.edu07/31/1996
bstalleyc00572461BevinStalleybevin-stalley@uiowa.edu11/17/1994
ebernhardssond00633707EvaleenBernhardssonevaleen-bernhardsson@uiowa.edu03/21/1990
mponcete00004601MichailPoncetmichail-poncet@uiowa.edu11/18/2019
mhartiganf00316331MacHartiganmac-hartigan@uiowa.edu03/01/1991
hpawelekg00214424HestherPawelekhesther-pawelek@uiowa.edu11/25/2002
atuteh00167917ArlanTutearlan-tute@uiowa.edu04/30/2018
jcornbilli00337376JoanaCornbilljoana-cornbill@uiowa.edu10/02/2001
mfeelyj00441189MeredithFeelymeredith-feely@uiowa.edu05/01/2019
gdowk00093302GabiDowgabi-dow@uiowa.edu08/19/2008
bandragl00180957BurlAndragburl-andrag@uiowa.edu04/06/1991
ewyndhamm00465889EmanuelWyndhamemanuel-wyndham@uiowa.edu04/15/2015
atschirschkyn00471829AlisaTschirschkyalisa-tschirschky@uiowa.edu04/06/1995
emarklino00111055EdinMarklinedin-marklin@uiowa.edu07/16/1993
pinottp00549245PortyInottporty-inott@uiowa.edu06/19/1991
hgawithq00752282HuntleyGawithhuntley-gawith@uiowa.edu01/05/2016
msellimanr00569992MikelSellimanmikel-selliman@uiowa.edu04/20/2020
mramsiers00679501MarilynRamsiermarilyn-ramsier@uiowa.edu03/22/2004
kheggisont00151064KenHeggisonken-heggison@uiowa.edu02/22/1993
ftodeou00355900FreddyTodeofreddy-todeo@uiowa.edu07/16/1991
wbaggotv00949758WellsBaggotwells-baggot@uiowa.edu02/06/2007
shaughw00587247SaschaHaughsascha-haugh@uiowa.edu03/26/1994
nluebbertx00846605NatalyaLuebbertnatalya-luebbert@uiowa.edu12/21/1993
cbelfragey00624156ChrysaBelfragechrysa-belfrage@uiowa.edu03/14/2009
rqualtroz00857855RuggieroQualtroruggiero-qualtro@uiowa.edu08/07/2004
fbird1000409574FrankBirdfrank-bird@uiowa.edu11/10/2015
mschachter1100166832MargerySchachtermargery-schachter@uiowa.edu05/26/1990
dlauderdale1200792283DennieLauderdaledennie-lauderdale@uiowa.edu02/24/1999
tscoates1300217643TresaScoatestresa-scoates@uiowa.edu02/21/2015
lbarmby1400782331LeonoraBarmbyleonora-barmby@uiowa.edu06/22/2018
jantonomoli1500403864JoseitoAntonomolijoseito-antonomoli@uiowa.edu03/14/2014
kkeyme1600164961KrissyKeymekrissy-keyme@uiowa.edu11/28/2001
hphilipot1700980816HamPhilipotham-philipot@uiowa.edu05/19/2007
mmattei1800615865MicaelaMatteimicaela-mattei@uiowa.edu01/14/2001
wstollenhof1900829399WellsStollenhofwells-stollenhof@uiowa.edu01/19/2005
pstainer1a00823585PatriziaStainerpatrizia-stainer@uiowa.edu09/23/1996
gscorey1b00166860GrayScoreygray-scorey@uiowa.edu03/31/1994
jkinghorn1c00579953JanettaKinghornjanetta-kinghorn@uiowa.edu12/31/1994
fmorfey1d00022499FlorinaMorfeyflorina-morfey@uiowa.edu04/10/2003
rcampbell1e00310438RodgeCampbellrodge-campbell@uiowa.edu12/21/2010
chaysey1f00691254CelindaHayseycelinda-haysey@uiowa.edu01/09/2003
vapplin1g00427255VivienneApplinvivienne-applin@uiowa.edu09/01/2008
mbernholt1h00471504MattheusBernholtmattheus-bernholt@uiowa.edu03/15/2005
norviss1i00323354NertiOrvissnerti-orviss@uiowa.edu12/14/2008
jbondar1j00184441JoshiaBondarjoshia-bondar@uiowa.edu10/02/2005
fravelus1k00521656FaydraRavelusfaydra-ravelus@uiowa.edu06/01/1998
wspratt1l00709251WynnSprattwynn-spratt@uiowa.edu11/28/2021
mcleaton1m00007808MyrtleCleatonmyrtle-cleaton@uiowa.edu07/24/1991
dknyvett1n00558039DaiseyKnyvettdaisey-knyvett@uiowa.edu09/25/1994
sdorrian1o00908864StafordDorrianstaford-dorrian@uiowa.edu11/18/2006
cle1p00843092CayeLe Sarrcaye-le sarr@uiowa.edu03/05/2015
nocaine1q00241332NorthO'Cainenorth-o'caine@uiowa.edu05/07/2018
jniese1r00093807JaninaNiesejanina-niese@uiowa.edu03/18/1997
lhawtry1s00676694LauraHawtrylaura-hawtry@uiowa.edu03/15/1994
iplumbe1t00219681IvePlumbeive-plumbe@uiowa.edu08/16/2015
fkeitch1u00327289FredericKeitchfrederic-keitch@uiowa.edu03/28/2015
elalor1v00638318ElisabettaLalorelisabetta-lalor@uiowa.edu04/07/1998
tpyson1w00464225TamasPysontamas-pyson@uiowa.edu06/15/2002
gokeefe1x00146544GretelO'Keefegretel-o'keefe@uiowa.edu01/22/2012
ndrinan1y00532978NeroDrinannero-drinan@uiowa.edu08/04/2017
csplain1z00966293CecillaSplaincecilla-splain@uiowa.edu04/21/2021
apuckett2000895741AbiePuckettabie-puckett@uiowa.edu05/23/2008
felmes2100395781FonzElmesfonz-elmes@uiowa.edu01/19/1991
mdeporte2200881930MilDeportemil-deporte@uiowa.edu04/05/1995
geastmead2300617432GrettaEastmeadgretta-eastmead@uiowa.edu10/13/1995
wpanas2400045500WayPanasway-panas@uiowa.edu08/09/2017
zbarling2500078128ZorinaBarlingzorina-barling@uiowa.edu08/16/1998
pbergstram2600375188PriceBergstramprice-bergstram@uiowa.edu11/27/2009
fteasdale2700927101FairTeasdalefair-teasdale@uiowa.edu03/03/1990
bholston2800181238BrockyHolstonbrocky-holston@uiowa.edu12/15/2018
ewalasik2900751738ErmannoWalasikermanno-walasik@uiowa.edu06/06/2004
pruxton2a00852703PabloRuxtonpablo-ruxton@uiowa.edu04/28/1991
jcopeman2b00819011JoeCopemanjoe-copeman@uiowa.edu07/24/2011
rmcshee2c00682567RobeniaMcSheerobenia-mcshee@uiowa.edu01/03/1996
adunkinson2d00817602AnnaleeDunkinsonannalee-dunkinson@uiowa.edu04/20/1993
scolquit2e00325842SigfridColquitsigfrid-colquit@uiowa.edu10/20/1992
gfrowen2f00289843GloriFrowenglori-frowen@uiowa.edu05/29/2013
rsannes2g00346699RebaSannesreba-sannes@uiowa.edu04/26/2017
cheeron2h00929705CoryHeeroncory-heeron@uiowa.edu03/14/2004
pkynoch2i00874844PaceKynochpace-kynoch@uiowa.edu07/11/2015
omarnane2j00776460OlvaMarnaneolva-marnane@uiowa.edu09/18/2003
lreiglar2k00533738LouieReiglarlouie-reiglar@uiowa.edu10/29/2018
yvigours2l00982156YorkerVigoursyorker-vigours@uiowa.edu06/20/2001
khails2m00467737KerrHailskerr-hails@uiowa.edu04/26/2016
lmcalpin2n00315938LillaMcAlpinlilla-mcalpin@uiowa.edu12/28/1994
amanagh2o00765071AllinaManaghallina-managh@uiowa.edu07/16/2016
snoddle2p00372596SkyeNoddleskye-noddle@uiowa.edu06/05/2016
vgirard2q00676910VereGirardvere-girard@uiowa.edu03/23/2016
diapico2r00566940DelmorIapicodelmor-iapico@uiowa.edu04/27/2006

Custom rendering

Custom rendering is possible using scoped slots. It's possible to provide custom rendering for the thead, tbody and tfoot elements. Scoped slots use the following naming syntax:

  • thead: head(<fieldkey>)
  • tbody: body(<fieldkey>)
  • tfoot: foot(<fieldkey>)

Scoped field slots

Scoped field slots give you greater control over how the record data appears. You can use scoped slots to provide custom rendering for a particular field. If you want to add an extra field which does not exist in the records, just add it to the fields array, and then reference the field(s) in the scoped slot(s).

You can use the default fall-back scoped slot body() to format any cells that do not have an explicit scoped slot provided.

Index
Hawk ID
Display Name
Email
Retired
1cyepiskov0Yepiskov, Chanceychancey-yepiskov@uiowa.edu
2beyden1Eyden, Beaufortbeaufort-eyden@uiowa.edu
3fstokey2Stokey, Frankyfranky-stokey@uiowa.edu
4mloisi3Loisi, Maximilienmaximilien-loisi@uiowa.edu
5ckunkler4Kunkler, Cyrilluscyrillus-kunkler@uiowa.edu

The slot's scope variable (data in the above example) will have the following properties:

Property
Type
Description
indexNumberThe row number (indexed from zero) relative to the *displayed* rows. Note: index will not always be the actual row's index number, as it is computed after filtering, sorting and pagination have been applied to the original table data. The index value will refer to the displayed row number.
itemObjectThe entire raw record data (i.e. items[index]) for this row (before any formatter is applied)
valueAnyThe value for this key in the record (null or undefined if a virtual column), or the output of the field's formatter function
unformattedAnyThe raw value for this key in the item record (null or undefined if a virtual column), before being passed to the field's formatter function
fieldObjectThe field's field definition object

Formatter callback

Optionally, you can customize field output by using a formatter callback function. To enable this, the field's formatter property is used. The value of this property may be a String or a function reference.

When providing formatter as a Function, it can be a function from your component or an anonymous function. The callback function accepts three arguments - value, key, and item, and should return the formatted value as a string (HTML strings are not supported)

Note: If a formatted column is sortable, you probably also want to include sortByFormatted: true. See the status column in the example below. Additionally, users may want to filter by the formatted value. In that case, use filterByFormatted. See the field defintion reference for details.

Hawk ID
Univ ID
Display Name
Email
Status
cyepiskov000549444Yepiskov, Chanceychancey-yepiskov@uiowa.eduInactive
beyden100120802Eyden, Beaufortbeaufort-eyden@uiowa.eduActive
fstokey200341804Stokey, Frankyfranky-stokey@uiowa.eduInactive
mloisi300769787Loisi, Maximilienmaximilien-loisi@uiowa.eduActive
ckunkler400580573Kunkler, Cyrilluscyrillus-kunkler@uiowa.eduActive

Built-in Formatters

In case of a String value, it must be one of the following predefined, built-in formatters:

  • currency: this is for Number fields that you would like to be displayed as a string, in a currency format. You can append the following optional options, delimited by a pipe |:
    • minimumIntegerDigits (Possible values are from 1 to 21; the default is 1)
    • minimumFractionDigits (Possible values are from 0 to 20; the default is 2)
    • maximumFractionDigits (Possible values are from 0 to 20; the default is 2)
  • parseCurrency: parses a string that is already in a currency format to a number. Primary use for this would be in field's sortFormatter so that you can sort by number rather than string.
  • number: this is for Number fields that you would like displayed as a string, in a number format. You can append the following optional options, delimited by a pipe |:
    • minimumIntegerDigits (Possible values are from 1 to 21; the default is 1)
    • minimumFractionDigits (Possible values are from 0 to 20; the default is 0)
    • maximumFractionDigits (Possible values are from 0 to 20; the default is 0)
  • percent: this is for a Number field where the percent is represented as a decimal. You can append the following optional options, delimited by a pipe |
    • minimumIntegerDigits (Possible values are from 1 to 21; the default is 1)
    • minimumFractionDigits (Possible values are from 0 to 20; the default is 2)
    • maximumFractionDigits (Possible values are from 0 to 20; the default is 2)
  • date: this for formatting dates, or string representations of dates, to strings. You can append the following optional option: delimited by a pipe |
    • format (default is MM/DD/YYYY)
  • dateTime: this is for formatting dateTimes, or string representations of dateTimes, to strings. You can append the following optional option: delimited by a pipe |
    • format (default is MM/DD/YYYY h:mmA)
  • phone: this is for formatting a Number or String to a phone number format. This currently supports domestic phone numbers

Example: Custom data rendering using predefined, built-in formatters:

Example 1 - currency, number, and percent
Currency
Currency Rounded
Number
Number Rounded
Percent
Percent to 3 Decimals
$123,456.78$123,457123,456123,456.34623.23%23.230%
$123,456.78$123,456654,321654,320.9880.33%0.333%
Example 2 - date, dateTime, and phone
Date
String Date
DateTime
String DateTime
Phone
Phone 2
01/17/20222023-01-2102/23/2022 00:0002/23/2022 15:30(319) 335-3500(319) 335-3500
02/17/20212022-02-1702/23/2021 00:0002/23/2021 15:30(319) 335-3500335-3500
Example 3 - sortFormatter (sort these fields to see the difference in behavior)
with 'sortFormatter'
without 'sortFormatter'
with 'sortFormatter'
without 'sortFormatter'
$123,456$123,45611/21/202211/21/2022
$77,456$77,45601/21/202301/21/2023

Custom rendering for the tables thead and tfoot elements. Note by default the table footer is not rendered unless foot-clone is set to true. If a foot(...) slot for a field is not provided, but a head(...) slot is provided, then the footer will use the head(...) slot content.

You can use a default fall-back scoped slot head() or foot() to format any header or footer cells that do not have an explicit scoped slot provided.

Hawk ID
Univ ID
DISPLAY NAME
Email
Hire Date
cyepiskov000549444Yepiskov, Chanceychancey-yepiskov@uiowa.edu05/09/1990
beyden100120802Eyden, Beaufortbeaufort-eyden@uiowa.edu06/05/1998
fstokey200341804Stokey, Frankyfranky-stokey@uiowa.edu06/11/1993
mloisi300769787Loisi, Maximilienmaximilien-loisi@uiowa.edu01/02/1996
ckunkler400580573Kunkler, Cyrilluscyrillus-kunkler@uiowa.edu06/30/1990
Hawk ID
Univ ID
Display Name
Email
Hire Date

If you'd like to include an icon in your header or footer column, just use the icon field property. This property supports a string for core icons or an object for other FontAwesome icons.

Hawk ID
Univ ID
Display Name
Email
Hire Date
cyepiskov000549444Yepiskov, Chanceychancey-yepiskov@uiowa.edu05/09/1990
beyden100120802Eyden, Beaufortbeaufort-eyden@uiowa.edu06/05/1998
fstokey200341804Stokey, Frankyfranky-stokey@uiowa.edu06/11/1993
mloisi300769787Loisi, Maximilienmaximilien-loisi@uiowa.edu01/02/1996
ckunkler400580573Kunkler, Cyrilluscyrillus-kunkler@uiowa.edu06/30/1990
Hawk ID
Univ ID
Display Name
Email
Hire Date

Filtering

Filtering, when used, will filter the original items array. AisTable provides several options for how data is filtered.

If you are using a formatter on a column, users may want to filter results on the formatted value. In that case, use filterByFormatted. See the field defintion reference for details. Note: It is currently not possible to filter on formatted results when using scoped field slots

Filtering by string query

When filtering by string query, the data will be filtered only by the fields which are listed in the fields array, and therefore will not be filtered by item fields that are not displayed in your table.

Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
cyepiskov000549444ChanceyYepiskovchancey-yepiskov@uiowa.edu05/09/1990
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998
fstokey200341804FrankyStokeyfranky-stokey@uiowa.edu06/11/1993
mloisi300769787MaximilienLoisimaximilien-loisi@uiowa.edu01/02/1996
ckunkler400580573CyrillusKunklercyrillus-kunkler@uiowa.edu06/30/1990

Displayed Columns

AisTable provides two types of column filters; one for dates and one for all other types. Use the boolean field properties dateFilter and/or filter, respectively, to enable the column filter for each field that you desire having a column filter on.

Hawk ID
Univ ID
First Name
Last Name
Retired
Hire Date
ckunkler400580573CyrillusKunkler06/30/1990
jcooper1100549444JohnCooper05/09/1990
scooper301133454SteveCooper01/09/2010
beyden100120802BeaufortEyden06/05/1998
fstokey200341804FrankyStokey06/11/1993
mloisi300769787MaximilienLoisi01/02/1996
nroggerone500815761NoellaRoggerone03/08/1990
tmcnamara600198639TannieMcNamara12/26/2000
csneesby700846913CherlynSneesby09/20/2020
lcouves800541147LinnellCouves05/28/1997

Non-Displayed Columns

If you would like to filter on item fields that are not displayed in your table, then you just need to add the field key(s) to the cols attribute of an object that you provide to the filter prop on the AisTable. If you also have a string query filter, just add a query attribute to this object and make sure your query input field points to this attribute.

Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
ckunkler400580573CyrillusKunklercyrillus-kunkler@uiowa.edu06/30/1990
jcooper1100549444JohnCooperjohn-cooper@uiowa.edu05/09/1990
scooper301133454SteveCoopersteve-cooper@uiowa.edu01/09/2010
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998
fstokey200341804FrankyStokeyfranky-stokey@uiowa.edu06/11/1993

Busy

AisTable provides a busy prop that will flag the table as busy, which you can set to true just before you update your items, and then set it to false once you have your items. When in the busy state, the table will have the attribute aria-busy="true".

You may optionally provide a table-busy slot to show a custom loading message or spinner whenever the table's busy state is true. The slot will be placed in a <tr> element with a class busy-row, which has one single <td> with a colspan set to the number of fields.

Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
cyepiskov000549444ChanceyYepiskovchancey-yepiskov@uiowa.edu05/09/1990
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998
fstokey200341804FrankyStokeyfranky-stokey@uiowa.edu06/11/1993
mloisi300769787MaximilienLoisimaximilien-loisi@uiowa.edu01/02/1996
ckunkler400580573CyrillusKunklercyrillus-kunkler@uiowa.edu06/30/1990

Caption

Add an optional caption to your table via the caption prop or the caption slot (the slot takes precedence over the prop).

Caption using the 'caption' prop
Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
cyepiskov000549444ChanceyYepiskovchancey-yepiskov@uiowa.edu05/09/1990
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998
Caption using the 'caption' slot
Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
cyepiskov000549444ChanceyYepiskovchancey-yepiskov@uiowa.edu05/09/1990
beyden100120802BeaufortEydenbeaufort-eyden@uiowa.edu06/05/1998

Empty

Display a message for tables that have no data to display via the show-empty boolean prop. In order for this message to be displayed, items must be either falsy or an array of length 0.

Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
There are no records to show

Custom Message

Display a custom message via the empty-text prop or the empty slot. In order for this message to be displayed, the show-empty prop must be set to true and items must be either falsy or an array of length 0. The default empty message is, "There are no records to show".

Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
No results found! (using prop)
Hawk ID
Univ ID
First Name
Last Name
Email
Hire Date
No results found! (using slot)

Custom Filtered Message

For a custom message when filtering results in no data to display, use the empty-filtered-text prop or emptyFiltered slot. In order for this message to be displayed, the show-empty prop must be set to true and the filtered items array must be empty. The default empty filtered message is, "There are no records matching your filter values".

Complete Example

Faculty List
Univ ID
Display Name
Email
Hire Date
1
Retired
00927101Teasdale, Fairfair-teasdale@uiowa.edu03/03/1990
00815761Roggerone, Noellanoella-roggerone@uiowa.edu03/08/1990
00633707Bernhardsson, Evaleenevaleen-bernhardsson@uiowa.edu03/21/1990
00549444Cooper, Johnjohn-cooper@uiowa.edu05/09/1990
00166832Schachter, Margerymargery-schachter@uiowa.edu05/26/1990
00580573Kunkler, Cyrilluscyrillus-kunkler@uiowa.edu06/30/1990
00395781Elmes, Fonzfonz-elmes@uiowa.edu01/19/1991
00316331Hartigan, Macmac-hartigan@uiowa.edu03/01/1991
00180957Andrag, Burlburl-andrag@uiowa.edu04/06/1991
00852703Ruxton, Pablopablo-ruxton@uiowa.edu04/28/1991

Component Reference

Props

Property
1
Type(s)
Description
Required
Default
bordered
Boolean
Adds borders to all the cells and headers
false
borderless
Boolean
Removes all borders from cells
false
busy
Boolean
When set, forces the table into the busy state.Automatically set when an items provider function is being called
false
caption
String
Text string to place in the caption element
''
currentPage
Number, String
The current page number to display when the table is paginated
1
emptyFilteredText
String
Text string to show when the table has no items to show due to filtering
'There are no records matching your filter values'
emptyText
String
Text string to show when the table has no items to show
'There are no records to show'
fields
Array
Array of field names or array of field definition objects
[]
filter
Object, String
Criteria for filtering. Internal filtering supports only string or RegExpr criteria.
''
flush
Boolean
when it's nested inside a card that has no-body prop set
false
footClone
Boolean
Enable to the footer of the table, and clone the header content by default
false
footRowVariant
String
Apply a color variant to the tr element in the tfoot. Falls back to head-row-variant
Valid values:
primary, secondary
''
footVariant
String
Apply a color variant to the tfoot element. Falls back to head-variant May take precedence over foot-row-variant
Valid values:
primary, secondary
''
headRowVariant
String
Apply a color variant to the tr element in the thead
Valid values:
primary, secondary
''
headVariant
String
Apply a color variant to the thead element. May take precedence over head-row-variant
Valid values:
primary, secondary
''
hover
Boolean
Enables hover styling on rows
false
id
String
Used to set the id attribute on the rendered content, and used as the base to generate any additional element IDs as needed
''
items
Array
Array of items to display
[]
large
Boolean
Renders the table with larger cell padding and larger text size. Same as size="lg"
false
noBorderCollapse
Boolean
Disable's the collapsing of table borders. Useful when table has sticky headers or columns
false
outlined
Boolean
Adds an outline border to the table element
false
perPage
Number, String
Number of rows to show per page. Set to 0 to disable pagination
0
primaryKey
String
Name of a table field that contains a guaranteed unique value per row. Needed for tbody transition support, and also speeds up table rendering
'id'
ruled
Boolean
Applies borders between the tbody rows
false
showEmpty
Boolean
When enabled, and there are no item records to show, shows a message that there are no rows to show
false
size
String
Renders the table with appropriate cell padding and font-size
''
small
Boolean
Renders the table with smaller cell padding and smaller text size. Same as size="sm"
false
sortBy
Array
Array of string field keys that are currently being sorted by. Prepend any field key with - to sort descending for that field. Set to null or [] to clear sorting.
[]
sortNullFirst
Boolean
Set this prop to sort null and undefined values first. By default, null and undefined values will be sorted last (or first, when sorting descending). Only applicable to internal sorting
false
stickyBottom
String
The value that the sticky footer should begin sticking (i.e. bottom-0 or bottom-[20px] etc...)
'bottom-0'
stickyHeaders
Boolean, String
Makes the table header sticky. Set to true for a maximum height 300px tall table, or set to any valid CSS height (including units)
false
stickyTop
String
The value that the sticky headers should begin sticking (i.e. top-0 or top-[20px] etc...)
'top-0'
striped
Boolean
Applies striping to the tbody rows
false
tableClass
Array, Object, String
CSS class (or classes) to apply to the table element
''
tbodyClass
Array, Object, String
CSS class (or classes) to apply to the tbody element
''
tbodyTrClass
Array, Func, Object, String
CSS class (or classes) to apply to the tr element in the tbody. Can be a function that accepts an instance of the item for that row
''
tfootClass
Array, Object, String
CSS class (or classes) to apply to the tfoot element
''
tfootTrClass
Array, Object, String
CSS class (or classes) to apply to the tr element in the tfoot
''
theadClass
Array, Object, String
CSS class (or classes) to apply to the thead element
''
theadTrClass
Array, Object, String
CSS class (or classes) to apply to the tr element in the thead
''

Slots

Name
1
Scoped
Description
body({field.key})
Scoped slot for custom data rendering of field data. {field.key} is the field's key name. See Scoped Field Slots
foot({field.key})
Scoped slot for custom rendering of field footer. {field.key} is the field's key name. See Scoped Header & Footer Slots
head({field.key})
Scoped slot for custom rendering of field header. {field.key} is the field's key name. See Scoped Header & Footer Slots
body()
Default scoped slot for custom data rendering of field data. See Scoped Field Slots
caption
No
Content to display in the table's caption element
empty
Content to display when no items are present in the items prop. Optionally scoped
emptyFiltered
Content to display when no items are present in the items prop. Optionally scoped
foot()
Default scoped slot for custom rendering of field footer. See Scoped Header & Footer Slots
head()
Default scoped slot for custom rendering of field header. See Scoped Header & Footer Slots
table-busy
No
Optional slot to place loading message when table is in the busy state

Events

Event
1
Arguments
Description
filtered
  • filteredItems
    array
    -
    Array of items after filtering (before local pagination occurs)
Emitted when local filtering causes a change in the number of items
head-clicked
  • key
    string
    -
    Column key clicked (field name)
  • field
    object
    -
    Field definition object
  • event
    object
    -
    Native event object
  • isFooter
    boolean
    -
    true if this event originated from clicking on the footer cell
Emitted when a header or footer cell is clicked
row-clicked
  • item
    object
    -
    Item data of the row being clicked
  • index
    number
    -
    Index of the row being clicked
  • event
    object
    -
    Native event object
Emitted when a row is clicked
row-contextmenu
  • item
    object
    -
    Item data of the row being clicked
  • index
    number
    -
    Index of the row being clicked
  • event
    object
    -
    Native event object
Emitted when a row is right clicked
row-dblclicked
  • item
    object
    -
    Item data of the row being clicked
  • index
    number
    -
    Index of the row being clicked
  • event
    object
    -
    Native event object
Emitted when a row is double-clicked
row-hovered
  • item
    object
    -
    Item data of the row being clicked
  • index
    number
    -
    Index of the row being clicked
  • event
    object
    -
    Native event object
Emitted when a row is hovered
row-unhovered
  • item
    object
    -
    Item data of the row being clicked
  • index
    number
    -
    Index of the row being clicked
  • event
    object
    -
    Native event object
Emitted when a row is unhovered
sort-changed
  • item
    object
    -
    The array representing the new sort order
Emitted when the sorting on the table has changed