Grid
import {Grid} from 'cx/widgets';Grid is a versatile component used to display tabular data. Grid control in Cx has many features such as fixed headers, single and multiple selection modes, sorting, filtering, grouping and aggregation, rich cell content (including headers), tree columns, etc.
| Name | Continent | Browser | OS | Visits |
|---|---|---|---|---|
| Cora Waters | Europe | Firefox | Android | 39 |
| Hollie Price | North America | Safari | iOS | 92 |
| Adelle Heller | Australia | Safari | Mac OS | 99 |
| Cristal Trantow | Antarctica | Edge | Windows | 23 |
| Rodrick Carter | Australia | Opera | Mac OS | 84 |
| Rosalinda Kovacek | Europe | Safari | Mac OS | 26 |
| Walter Dooley | Australia | Internet Explorer | Android | 62 |
| Orland Steuber | Australia | Firefox | Ubuntu | 61 |
| Stewart Cummings | Australia | Opera | iOS | 43 |
| Lacey Haley | North America | Firefox | Ubuntu | 15 |
| Alvera Bruen | Africa | Internet Explorer | Ubuntu | 14 |
| Leland Dooley | Europe | Firefox | Ubuntu | 99 |
| Hosea Daniel | South America | Internet Explorer | Mac OS | 66 |
| Rylee Mueller | North America | Safari | Mac OS | 49 |
| Meda Wolff | Antarctica | Firefox | Mac OS | 48 |
| Kenyatta Rosenbaum | Asia | Internet Explorer | Mac OS | 81 |
| Nadia Heller | Australia | Firefox | Windows | 6 |
| Tate Spencer | South America | Edge | Mac OS | 68 |
| Jamey Lindgren | South America | Opera | Mac OS | 32 |
| Breana Wyman | Europe | Opera | Mac OS | 92 |
| Rubie Fay | North America | Internet Explorer | Android | 6 |
| Tyreek Macejkovic | Africa | Chrome | Ubuntu | 80 |
| Milan Parker | Asia | Edge | Android | 20 |
| Justus Purdy | North America | Firefox | Ubuntu | 83 |
| Rolando Feil | South America | Opera | iOS | 4 |
| London Schumm | Asia | Safari | Android | 24 |
| Tracey Kling | South America | Safari | Mac OS | 11 |
| Kaycee Predovic | South America | Edge | Ubuntu | 17 |
| Cathy Kihn | Europe | Opera | Windows | 43 |
| Shad Bartell | South America | Opera | Ubuntu | 42 |
| Dominic Koch | Asia | Safari | Mac OS | 52 |
| Vallie Altenwerth | South America | Chrome | Android | 69 |
| Alexzander Harber | South America | Chrome | Android | 80 |
| Zola Windler | South America | Firefox | Ubuntu | 79 |
| Caleb Stoltenberg | Africa | Safari | Windows | 60 |
| Larissa Rippin | Africa | Opera | Android | 47 |
| Dayton McKenzie | North America | Internet Explorer | Ubuntu | 42 |
| Jolie Considine | Asia | Internet Explorer | Ubuntu | 11 |
| Kennith Ratke | Australia | Firefox | Mac OS | 43 |
| Jayme Goyette | Australia | Internet Explorer | Mac OS | 61 |
| Irma Connelly | South America | Chrome | Android | 42 |
| Sim Carroll | Africa | Opera | Ubuntu | 5 |
| Otilia Shields | Europe | Internet Explorer | Mac OS | 91 |
| Leone Howe | Antarctica | Safari | Mac OS | 76 |
| Gordon Jaskolski | Africa | Opera | Android | 92 |
| Isai Stark | North America | Safari | Android | 98 |
| Kayli Hilll | North America | Safari | Android | 31 |
| Donna Thompson | Asia | Safari | Android | 39 |
| Ramon Kirlin | Europe | Opera | Android | 72 |
| Maryse Kuphal | Antarctica | Firefox | Android | 26 |
| Lucie Predovic | Asia | Firefox | Ubuntu | 19 |
| Felicity Rau | South America | Opera | Ubuntu | 72 |
| Josiah Wiegand | Australia | Edge | Ubuntu | 37 |
| Alysa Conn | South America | Safari | Android | 36 |
| Gino Hauck | Asia | Edge | Android | 32 |
| Bernadette Graham | Asia | Opera | Android | 66 |
| Joseph Tillman | Africa | Edge | Mac OS | 75 |
| Raven Aufderhar | North America | Safari | Ubuntu | 95 |
| Orville Weber | Africa | Chrome | Ubuntu | 76 |
| Landen Cummings | Australia | Internet Explorer | Mac OS | 37 |
| Barton Runolfsson | Africa | Internet Explorer | Windows | 60 |
| Jerad Reinger | Australia | Opera | Android | 52 |
| Arianna Paucek | Africa | Firefox | Ubuntu | 30 |
| Reina Krajcik | Antarctica | Edge | Android | 76 |
| Yoshiko Zemlak | Australia | Safari | Windows | 48 |
| Bernice Gibson | Africa | Internet Explorer | Android | 30 |
| Jeanie Connelly | Africa | Opera | Android | 37 |
| Jamil Dach | South America | Opera | Mac OS | 15 |
| Stanford Stehr | South America | Safari | Android | 77 |
| Nella Dickens | Antarctica | Firefox | iOS | 23 |
| Lazaro Marquardt | Africa | Opera | iOS | 43 |
| Lawson Kunde | South America | Firefox | Windows | 23 |
| Caesar Hagenes | Australia | Internet Explorer | Ubuntu | 38 |
| Adan Rice | Africa | Internet Explorer | Ubuntu | 89 |
| Melyssa Turcotte | Asia | Safari | iOS | 86 |
| Adriel Corkery | South America | Firefox | Mac OS | 5 |
| Tyree Kirlin | Asia | Opera | Android | 47 |
| Alysa Nicolas | Australia | Internet Explorer | Android | 20 |
| Beatrice Moore | Asia | Safari | iOS | 9 |
| Keagan Blick | Antarctica | Firefox | Android | 54 |
| Vivienne Jaskolski | South America | Firefox | Android | 67 |
| Tania Ondricka | Australia | Safari | Android | 99 |
| Lavon Corkery | Asia | Internet Explorer | Mac OS | 19 |
| Stephan Grimes | North America | Firefox | Ubuntu | 20 |
| Kennith Zulauf | Asia | Internet Explorer | Mac OS | 82 |
| Leslie Weber | Australia | Firefox | iOS | 62 |
| Hosea Christiansen | Asia | Opera | Ubuntu | 58 |
| Domenica Gusikowski | Australia | Internet Explorer | Ubuntu | 18 |
| Laurie Abshire | Antarctica | Opera | Mac OS | 4 |
| Buddy Schmeler | Australia | Internet Explorer | Mac OS | 46 |
| Baby Hackett | Australia | Opera | Android | 78 |
| Diamond Gottlieb | Europe | Internet Explorer | Windows | 30 |
| Kayli Walsh | Asia | Chrome | Android | 92 |
| Raheem Ankunding | South America | Edge | Android | 81 |
| Rita Tremblay | Australia | Safari | Android | 79 |
| Jonatan Metz | North America | Chrome | Ubuntu | 88 |
| Aliza Reynolds | North America | Firefox | Ubuntu | 13 |
| Kenny Weimann | Europe | Firefox | Android | 34 |
| Rosemary Bogisich | Africa | Chrome | Android | 24 |
| Aylin Robel | Australia | Internet Explorer | Android | 62 |
| Name | Continent | Browser | OS | Visits |
|---|
<Grid records-bind='$page.records' style={{width: "100%"}} columns={[ { header: 'Name', field: 'fullName', sortable: true }, { header: 'Continent', field: 'continent', sortable: true }, { header: 'Browser', field: 'browser', sortable: true }, { header: 'OS', field: 'os', sortable: true }, { header: 'Visits', field: 'visits', sortable: true, primarySortDirection: 'DESC' } ]} selection={{type: KeySelection, bind:'$page.selection'}} />
GridColumnColumn HeaderGroupingDrag & Drop
| Property | Description | Type |
|---|---|---|
border | Set to | boolean |
buffered | Set to | boolean |
cached | Set to | boolean |
clearableSort | If set, clicking on the column header will loop between ASC, DESC and no sorting order, instead of ASC and DESC only. | boolean |
columns | An array of columns. Check column configuration options in the section below. | array |
grouping | An array of grouping level definitions. Check allowed grouping level properties in the section below. | array |
headerMode | Determines header appearance. Supported values
are | string |
measureRowHeights | Used when rows have variable heights to improve buffered rendering by measuring
and caching rendered row heights. Default value is | boolean |
pageSize | Page size used to fetch records during infinite scrolling. Default value is | number |
records | An array of records to be displayed in the grid. | array |
scrollable | Set to | boolean |
selection | Selection configuration. See Selections for more details. | config |
sortDirection | A binding used to store the sort direction. Available only if | string |
sortField | A binding used to store the name of the field used for sorting grids. Available only if | string |
sorters | A binding used to store the sorting order list. Commonly used for server-side sorting. | array |
vlines | Set to | boolean |
allowsFileDrops | Set to | boolean |
bufferSize | Number of rendered rows in | number |
bufferStep | Number of rows to be scrolled before buffer adjustment. Default value is 15. | number |
class | Additional CSS classes to be applied to the element. If an object is provided, all keys with a "truthy" value will be added to the CSS class list. | string/object |
columnParams | Whenever | object |
dataAdapter | Data adapter is used for converting data in a list of records. Used to enable grouping and tree operations. See TreeGrid for more details. | object |
defaultSortDirection | Default sort direction. | string |
defaultSortField | Default sort field. Used if neither | string |
emptyText | Text to be displayed instead of an empty table. | string |
filterParams | Parameters which will be passed to the | object |
fixedFooter | Set to | boolean |
focusable | Set to | boolean |
groupingParams | Whenever | object |
hoverChannel | A value used to identify the group of components participating in hover effect synchronization. See HoverSync. | string |
lockColumnWidths | Set to true to lock column widths after the first render. This is helpful in pagination scenarios to maintain consistent looks across pages. | boolean |
mod | Appearance modifier. For example, | string/array |
onCreateFilter | Callback function used to create a filter. The function accepts | function |
onCreateIsRecordDraggable | Callback function used to specify which row is draggable. It should return a predicate which accepts a record and returns a boolean indicating wheter that record is draggable or not. | function |
onCreateIsRecordSelectable | Callback function used to specify which row is selectable and which not. | function |
onGetColumns | Callback function used to dynamically calculate columns.
The function accepts resolved | function |
onGetGrouping | Callback function to retrieve grouping data. Accepts | function |
onRef | Callback function to get grid component and instance references on component init. | function |
onRowClick | Callback function to be executed when a row is clicked. | function |
onRowContextMenu | Callback function to be executed when a row is right-clicked. | function |
onRowDoubleClick | Callback function to be executed when a row is double-clicked. | function |
onRowKeyDown | Callback function to be executed on key down. Accepts instance of the currently focused record as the second argument. | function |
onTrackMappedRecords | Callback function to track and retrieve displayed records. Accepts new records as a first argument. If onCreateFilter callback is defined, filtered records can be retrieved using this callback. See its usage in the example here. | function |
outerLayout | Defines the outer layout which wraps the widget. | widget |
preSorters | Additional sorters to be prepended to the actual list of sorters. | array |
preserveGroupOrder | When enabled, groups are shown in the same order as the source records. | boolean |
putInto | Used with outer layouts. Specifies the name of the content placeholder which should render the widget. | string |
remoteSort | Set to | boolean |
row | A parameter that allows defining multiple lines in a row.
Attributes of the | object |
rowHoverId | A value used to uniquely identify the record within the hover sync group. See HoverSync. | string |
scrollResetParams | Parameters whose change will cause the scroll to be reset. | object |
scrollSelectionIntoView | Set to | boolean |
sortOptions | Options for data sorting. See Intl.Collator options for more info. | record |
style | Style object applied to the wrapper div. Used for setting the dimensions of the element. | string/object |
vdomKey | Key that will be used as the key when rendering the React component. | string |
visible | Visibility of the widget. Defaults to | boolean |