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 |
|---|---|---|---|---|
| Coty Pfeffer | Europe | Safari | Ubuntu | 68 |
| Percival Kris | Europe | Firefox | Android | 35 |
| Jeremie Mitchell | South America | Internet Explorer | Android | 74 |
| Bailey Toy | Africa | Internet Explorer | iOS | 50 |
| Pedro Conn | Antarctica | Edge | Mac OS | 12 |
| Ahmad Lockman | Antarctica | Opera | Mac OS | 92 |
| Sydni Schowalter | Africa | Internet Explorer | Ubuntu | 32 |
| Johnnie Bayer | Australia | Chrome | Windows | 76 |
| Dominic Torp | Australia | Chrome | Windows | 78 |
| Dagmar Hauck | Asia | Safari | Android | 22 |
| Johnny Borer | South America | Internet Explorer | Android | 44 |
| Oscar Kling | South America | Edge | Mac OS | 36 |
| Lonzo Carroll | Africa | Chrome | Ubuntu | 70 |
| Quinn Leannon | Europe | Edge | Windows | 38 |
| Kaylah Bayer | Antarctica | Opera | Mac OS | 23 |
| Chelsea Sawayn | North America | Opera | Android | 62 |
| Brendon Nitzsche | North America | Opera | Android | 50 |
| Katrina Cremin | Antarctica | Opera | Ubuntu | 19 |
| Verner Gleichner | Australia | Opera | Ubuntu | 71 |
| Tyshawn Herman | North America | Opera | Ubuntu | 66 |
| Alexys Treutel | Antarctica | Firefox | Mac OS | 53 |
| Trisha Olson | Asia | Safari | Ubuntu | 19 |
| Helen Weissnat | Africa | Opera | Ubuntu | 22 |
| Prudence Stracke | North America | Opera | iOS | 96 |
| Damaris Buckridge | Asia | Edge | iOS | 96 |
| Kellen Davis | Europe | Internet Explorer | Android | 52 |
| Amira Feeney | Asia | Chrome | Android | 44 |
| Mustafa Jones | South America | Internet Explorer | Android | 22 |
| Maxine Shields | Africa | Edge | Ubuntu | 80 |
| Kaitlyn Wiza | Australia | Safari | Mac OS | 25 |
| Everett Little | North America | Safari | Ubuntu | 95 |
| Stewart Willms | Asia | Safari | Mac OS | 27 |
| Mireille Moen | Asia | Internet Explorer | Ubuntu | 55 |
| Dora Pagac | Asia | Opera | Mac OS | 87 |
| Itzel Gleichner | Australia | Opera | Mac OS | 25 |
| Victoria Konopelski | Africa | Internet Explorer | iOS | 11 |
| Carli Little | Africa | Safari | Android | 52 |
| Carrie Abbott | Europe | Internet Explorer | Android | 66 |
| Gerard Mohr | North America | Firefox | Ubuntu | 13 |
| Jayden Beier | South America | Opera | Mac OS | 71 |
| Isom Jerde | Europe | Internet Explorer | iOS | 8 |
| Dedrick Hilpert | North America | Internet Explorer | iOS | 2 |
| Bret Grady | North America | Firefox | Windows | 65 |
| Elsie Ortiz | Africa | Safari | Ubuntu | 94 |
| Zackary Mayer | Asia | Edge | Android | 54 |
| Vaughn Hintz | Europe | Opera | Android | 46 |
| Forrest Pfeffer | Europe | Firefox | iOS | 15 |
| Maybelle Schiller | North America | Internet Explorer | Mac OS | 1 |
| Naomi Quigley | Asia | Chrome | Android | 23 |
| Britney Kuhlman | Africa | Edge | Windows | 20 |
| Antoinette Ward | Asia | Firefox | Windows | 48 |
| Roger Runolfsson | Australia | Chrome | Mac OS | 21 |
| Linda Bauch | Europe | Safari | Ubuntu | 23 |
| Rosalyn Emard | Europe | Opera | Ubuntu | 27 |
| Pearline Konopelski | Asia | Edge | Mac OS | 89 |
| Tiffany Metz | Antarctica | Internet Explorer | Mac OS | 10 |
| Columbus Schinner | Antarctica | Edge | Android | 98 |
| Mckenna Doyle | Australia | Opera | iOS | 69 |
| Jalyn Keebler | Asia | Opera | Android | 62 |
| Freddie Jones | Africa | Opera | Android | 84 |
| Tobin Maggio | Europe | Opera | Windows | 66 |
| Caleb Hessel | Europe | Firefox | Ubuntu | 21 |
| Brisa Schamberger | North America | Firefox | Ubuntu | 31 |
| Vicente Gusikowski | Africa | Safari | Windows | 40 |
| Donald Medhurst | South America | Internet Explorer | Ubuntu | 28 |
| Cordia Boyle | Asia | Safari | Windows | 27 |
| Mina Watsica | North America | Internet Explorer | Ubuntu | 65 |
| Christelle Gerlach | Asia | Opera | iOS | 66 |
| Braulio Wunsch | Asia | Chrome | Android | 75 |
| Clement Vandervort | Antarctica | Chrome | Windows | 59 |
| Avis Huel | North America | Internet Explorer | Mac OS | 20 |
| Haylie Hoeger | Asia | Firefox | Android | 42 |
| Horace Zieme | Australia | Safari | Mac OS | 83 |
| Leonard Ritchie | Africa | Safari | Ubuntu | 45 |
| Tyrese Langworth | Antarctica | Internet Explorer | Android | 51 |
| Lyric Marks | Africa | Chrome | Mac OS | 48 |
| Reynold Bernier | North America | Opera | Android | 95 |
| Sheridan McKenzie | Asia | Opera | iOS | 81 |
| Tia McClure | Australia | Chrome | Windows | 72 |
| Remington Kuhlman | Australia | Internet Explorer | iOS | 22 |
| Devin Streich | Europe | Safari | Android | 43 |
| Sigrid Cronin | North America | Chrome | Mac OS | 11 |
| Diana Lebsack | Asia | Chrome | iOS | 97 |
| Jayda Green | Asia | Internet Explorer | Ubuntu | 50 |
| Florence Torphy | Africa | Firefox | Mac OS | 24 |
| Herminia Prohaska | Africa | Internet Explorer | Mac OS | 16 |
| Rocio Cronin | Antarctica | Opera | Android | 99 |
| Jackson Gusikowski | South America | Edge | Mac OS | 42 |
| Callie Conroy | Asia | Chrome | Ubuntu | 94 |
| Lon Muller | Australia | Opera | Ubuntu | 49 |
| Okey Wintheiser | Europe | Internet Explorer | iOS | 90 |
| Toney Nikolaus | Australia | Edge | Android | 41 |
| Alaina Murray | South America | Opera | Windows | 95 |
| Eulah Quigley | Africa | Safari | Ubuntu | 86 |
| Markus Gerlach | North America | Opera | Mac OS | 15 |
| Margarete Crist | Asia | Internet Explorer | Android | 25 |
| Burley Cartwright | Europe | Internet Explorer | iOS | 62 |
| Jodie Kub | North America | Safari | Windows | 65 |
| Louie Harris | Europe | Internet Explorer | Mac OS | 98 |
| Kiara Kunze | Australia | Firefox | Android | 18 |
| 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 |