Tables

Tables Javascript

Methods

Init()

const adminTable = new tables4i();
adminTable.Init({
	table: document.getElementById("productTable"),
	url: "/productcards/table",
	paging: {
		itemsToShow: 10,
		label: "Product Paging"
	},
	search: true,
	filter: true
});
				
ReloadTable()
adminTable.ReloadTable();
				
UpdateInitialSearch(searchTerm)

Uses search term value for tables that require a search before loading.

adminTable.UpdateInitialSearch(input.value);
				
UpdateUrl(url)

Uses fetch url that will return all table data.

adminTable.UpdateUrl(fetchURL);
				

Options

OptionRequiredTypeDescription
tableRequiredNode: Table IDThe actual table element.
urlRequiredStringThe route to get table row data.
pagingOptional{}Only include if paging is desired. Holds the values for paging below.
paging.itemsToShowOptionalIntegerThe initial number of rows the table needs to display.
paging.labelOptionalStringThe aria-label for the paging navigation.
searchOptionalBooleenOnly include if searching table is desired. true will allow searching.
filterOptionalBooleenOnly include if filtering table is desired. true will allow filtering.

Resources

Sass File(s)/sass/components/_tables.scss
JS File(s)Please use the table2024js bundle
/library/tables/common.js
/library/tables/filter.js
/library/tables/paging.js
/library/tables/search.js
/library/tables/tables.js
JS FunctionsSee Above.
Locale KeysNone

Accessibility

None at this time.

To Top of page