Skip to content

Table ​

A headless, native-<table> helper. monoDataGrid wraps a devextreme DataSource β€” or a plain array, which it pages, searches and sorts in memory (pass the array straight in; monoArraySource stays exported for advanced control) β€” and small controls β€” <mono-table-search>, <mono-table-paging>, <mono-table-page-size>, <mono-table-info>, <mono-table-sort> β€” drive search, paging, sorting and info while your <table> stays native. Bind the controller to each control with :data-grid.prop.

Basic ​

Native table with search, page size, info and paging wired through one controller.

External control ​

Filtering the DataSource directly still updates the table via its changed event.

Colors ​

A .mono-table-{color} class on the wrapper recolors the whole table β€” header, zebra rows, hover, search and pagination.

Sorting ​

Put <mono-table-sort field="…"> inside a native <th> for a sortable header β€” click to cycle asc β†’ desc β†’ none.

Fixed columns ​

Add mono-table-sticky-left / -right to a column's header <th> and its body <td>s to pin it on horizontal scroll β€” CSS only, no JS. A single pinned column per side needs nothing else. For two or more on the same side, give them fixed widths and set --mt-sticky-left / --mt-sticky-right on the later column(s) to the combined width of the ones before it, so they stack edge-to-edge.

Full example ​

Everything from a static array (monoArraySource): stat cards, filters, row selection, badges, progress and actions.

Grouping ​

Pass group to monoDataGrid along with a plain array or a DataSource β€” it handles the rest. table.displayRows gives a flat, keyed list to v-for over (each item is { kind: 'group' | 'row' | 'footer', key, level, node?, row? }), so your template just switches on kind β€” no tree walking, no key juggling. The main <mono-table-paging> pages the first layer of groups (and <mono-table-info> / <mono-table-page-size> count groups). Headers are collapsible via table.toggleGroup / expandAllGroups / collapseAllGroups.

To page the rows inside a group, set groupRowPageSize and render a <mono-table-paging-group :group.prop="item.node.path"> in the footer row; it slices that group to one page and navigates it.

<mono-table-page-size> takes an array of sizes that may include 'all' (:sizes.prop="[10, 20, 50, 'all']"). Choosing All shows everything at once β€” all groups, fully expanded β€” and for a remote source it loads the rows in chunkSize (default 100) requests, so a backend capped at 100 rows still returns the full set.

  • Plain array or multi-level group β†’ client (grouped + paged in memory; good for small/medium data).
  • Single-field group + remote DataSource β†’ automatic server-side paging. Nothing loads until shown: one cheap groupby gives the group list, counts, and any groupSummary aggregate (e.g. a subtotal); each visible group fetches only its current page of rows via $filter/$skip/$top. No loadGroups/loadRows to write β€” monoDataGrid drives the DataSource's store itself.

Multi-level grouping (Nama β†’ Code) over a small DataSource β€” grouped and paged in memory; the main pager pages the first layer:

Both pagers together (offline, static array) β€” the footer pager moves between groups, while each group's own <mono-table-paging-group> pages its rows:

Automatic server-side paging over a real DataSource (1200+ rows) β€” just monoDataGrid(dataSource, { group: ['DeptNama'], groupRowPageSize: 5, groupSummary: { TotalBudget: 'sum' } }). The main pager pages departments, each department lazily fetches only its current 5 rows, and the header count + subtotal come from one groupby. Open the Network tab: one groupby plus a few $top=5 calls β€” never a full load:

Types ​

Importimport { TableInfoProps, TableSortProps, TablePagingProps, TableSearchProps, TablePageSizeProps } from 'mono-helper'
PropValueDefaultDescription
<mono-table-info>
templatestring'Showing {from}–{to} of {total}'Override the "Showing {from}–{to} of {total}" template.
dataGridMonoTableController<any>β€”β€”
<mono-table-sort>
fieldstring''Column to sort by. Omit for a plain, non-sortable label.
captionstring''Header text (falls back to the element's text content).
disabledbooleanfalseβ€”
noClearbooleanfalseCycle asc ↔ desc only, never clearing.
dataGridMonoTableController<any>β€”β€”
<mono-table-paging>
siblingsnumber1How many numbered buttons to show around the current page (default 1).
simplebooleanfalseHide the numbered buttons, keep only Prev / Next.
dataGridMonoTableController<any>β€”β€”
<mono-table-search>
placeholderstring'Search…'β€”
disabledbooleanfalseβ€”
debouncenumber300β€”
noIconbooleanfalseHide the leading search icon.
dataGridMonoTableController<any>β€”β€”
<mono-table-page-size>
sizesstring | number[][10, 20, 50, 100]Options for the select (default [10, 20, 50, 100]).
labelstring''β€”
dataGridMonoTableController<any>β€”β€”