t×tecexpressby TeKOcloud
DEv0.7.1
Data & views / FLUTTER

TxDataGrid.

Interactive preview

Data table with single-column sorting, AND text filters, paging, selection and custom cells.

TxDataGrid

ParameterTypeDefaultMeaning
dataSourceObjectrequiredList, configuration or DataSource instance; takes precedence over items.
keyOfObject Function(T row)requiredReads the stable record key.
columnsList<TxColumn<T>>requiredColumn or card field configurations.
filterRowbooltrueShows the text filter row.
pageSizeint10Records per page.
pageIndexint?nullZero-based page index.
onPageIndexChangedValueChanged<int>?nullReports pageIndex; update controlled state in the callback.
selectionTxSelectionModeTxSelectionMode.noneSelection mode.
selectedRowKeysSet<Object>?nullControlled set of selected row keys.
onSelectedRowKeysChangedValueChanged<Set<Object>>?nullReports selectedRowKeys; update controlled state in the callback.
onSelectionChangedValueChanged<TxSelection<T>>?nullReports selection; update controlled state in the callback.
onRowClickValueChanged<T>?nullReports the clicked record.
onSortChangedvoid Function(String? field, bool descending)?nullReports sort; update controlled state in the callback.
onFilterChangedValueChanged<Map<String, String>>?nullReports filter; update controlled state in the callback.
loadingboolfalseShows the loading state.
disabledboolfalseDisables interaction.
noDataTextString'Keine Daten vorhanden.'Text for an empty collection.
labelString'Datentabelle'Label or accessible name.
dart
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';

Widget example() {
  final rows = <Map<String, Object>>[{'id': 1, 'name': 'Alex'}];
  return TxDataGrid<Map<String, Object>>(dataSource: rows, keyOf: (row) => row['id']!, columns: [TxColumn(caption: 'Name', valueGetter: (row) => row['name'])]);
}