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 |
|---|---|---|---|---|
| Karl Bosco | South America | Internet Explorer | Mac OS | 6 |
| Alexandro Mayer | Africa | Firefox | Ubuntu | 51 |
| Darren Nicolas | Africa | Firefox | Mac OS | 9 |
| Marlen Schmidt | Europe | Opera | Android | 93 |
| Leone McLaughlin | North America | Opera | Mac OS | 4 |
| Chadd Rolfson | North America | Edge | Windows | 19 |
| Abelardo Auer | South America | Opera | Mac OS | 7 |
| Kristoffer Carter | Australia | Edge | Mac OS | 9 |
| Valentin Fay | Antarctica | Opera | Ubuntu | 10 |
| Adrianna Kutch | Australia | Opera | Android | 69 |
| Harmon Bergstrom | Asia | Firefox | Windows | 88 |
| Zaria Cummerata | South America | Opera | Mac OS | 3 |
| Rigoberto Steuber | Asia | Internet Explorer | Mac OS | 88 |
| Hayley Wintheiser | Africa | Edge | Android | 37 |
| Misty Schmitt | Australia | Internet Explorer | Android | 63 |
| Haleigh Friesen | North America | Internet Explorer | Android | 34 |
| Shayne Von | Antarctica | Chrome | Mac OS | 33 |
| Gordon Howell | North America | Internet Explorer | Mac OS | 11 |
| Nicole McCullough | Australia | Internet Explorer | Windows | 63 |
| Monserrat Labadie | Africa | Safari | Ubuntu | 85 |
| Geovanny Klocko | Asia | Firefox | Android | 35 |
| Alfreda Torphy | Australia | Safari | Android | 88 |
| Brendan Dooley | North America | Firefox | Android | 42 |
| Andreanne Cronin | Europe | Opera | Ubuntu | 64 |
| Maia Mann | Australia | Safari | Android | 51 |
| Mandy Legros | Africa | Edge | Ubuntu | 70 |
| Damaris Dooley | Asia | Safari | Android | 6 |
| Tod Pouros | Asia | Opera | Ubuntu | 94 |
| Marcos Kub | Asia | Firefox | Mac OS | 8 |
| Adonis Dach | Asia | Safari | Android | 84 |
| Ursula Heidenreich | North America | Internet Explorer | Ubuntu | 26 |
| Randy Jerde | South America | Safari | Mac OS | 35 |
| Elvis Grady | South America | Opera | Android | 27 |
| Cruz Stiedemann | Asia | Safari | Windows | 84 |
| Tristin Sawayn | Australia | Chrome | Android | 64 |
| Monserrat Torp | North America | Opera | Ubuntu | 1 |
| Lillian Dare | North America | Edge | Mac OS | 75 |
| Celestino Schuppe | Asia | Safari | Mac OS | 35 |
| Ines Lubowitz | Africa | Internet Explorer | Windows | 44 |
| Rashad Langworth | South America | Firefox | Mac OS | 58 |
| Lowell Glover | Africa | Firefox | Windows | 85 |
| Dillan Predovic | Africa | Internet Explorer | Android | 31 |
| Gordon Dooley | North America | Safari | Ubuntu | 43 |
| Madilyn Thompson | South America | Safari | Android | 12 |
| Maximillian Adams | South America | Safari | Windows | 52 |
| Wendy Durgan | Africa | Opera | iOS | 83 |
| Judd Shanahan | Australia | Safari | Android | 60 |
| Jerad Dach | Africa | Firefox | Mac OS | 72 |
| Zackery Becker | Australia | Firefox | Android | 91 |
| Roberto Champlin | Europe | Edge | Mac OS | 93 |
| Charles Wyman | Asia | Edge | iOS | 48 |
| Beverly Bailey | Australia | Chrome | Ubuntu | 70 |
| Susie Hills | South America | Internet Explorer | Mac OS | 6 |
| Addison Borer | Antarctica | Safari | Mac OS | 11 |
| Eino Funk | Asia | Safari | Ubuntu | 48 |
| Emery Swift | Australia | Safari | Android | 37 |
| Ian Greenholt | Antarctica | Opera | Ubuntu | 76 |
| Mohamed Bradtke | Africa | Internet Explorer | iOS | 53 |
| Shyanne Klein | North America | Opera | Ubuntu | 13 |
| Adelbert Beatty | Australia | Safari | Windows | 7 |
| Wilfredo Kris | Asia | Edge | Mac OS | 39 |
| Anibal Miller | Africa | Safari | Mac OS | 24 |
| Kris Hayes | Africa | Firefox | Mac OS | 27 |
| Tianna Buckridge | South America | Firefox | Mac OS | 20 |
| Cathrine Baumbach | South America | Internet Explorer | Ubuntu | 3 |
| Camren Harvey | Europe | Internet Explorer | Mac OS | 72 |
| Cameron Dare | Europe | Firefox | Ubuntu | 16 |
| Toy Thompson | Africa | Internet Explorer | Windows | 77 |
| Chesley Stoltenberg | South America | Firefox | Mac OS | 66 |
| Gardner Balistreri | Asia | Edge | Ubuntu | 16 |
| Katherine Glover | Asia | Edge | Mac OS | 96 |
| Audreanne Von | North America | Chrome | Ubuntu | 13 |
| Clotilde Lindgren | Antarctica | Opera | Mac OS | 6 |
| Furman Kunde | Europe | Opera | Android | 16 |
| Monica Cruickshank | South America | Opera | Mac OS | 81 |
| Dan Klein | Europe | Safari | Mac OS | 5 |
| Jordon Goyette | Asia | Opera | Mac OS | 88 |
| Michelle Gaylord | North America | Edge | Ubuntu | 52 |
| Rickie Brown | South America | Firefox | Ubuntu | 82 |
| Christina Terry | Asia | Chrome | Windows | 5 |
| Yolanda Lockman | Australia | Firefox | Mac OS | 63 |
| Eugenia Lueilwitz | Africa | Opera | iOS | 76 |
| Felipa Reichert | South America | Internet Explorer | Ubuntu | 36 |
| Wendy Gerlach | Australia | Safari | Ubuntu | 46 |
| Tyra Miller | Australia | Opera | Ubuntu | 72 |
| Brayan Waelchi | Australia | Internet Explorer | Ubuntu | 42 |
| Jordan Marquardt | North America | Opera | Android | 91 |
| Jeff Daniel | South America | Opera | Mac OS | 22 |
| Muhammad Lynch | Asia | Firefox | Mac OS | 29 |
| Luisa Wyman | South America | Safari | Ubuntu | 46 |
| Grover Dare | Australia | Edge | Ubuntu | 9 |
| Hailee Nolan | Australia | Firefox | Android | 15 |
| Neal Mertz | Asia | Firefox | Android | 49 |
| Alan Langworth | Australia | Internet Explorer | Windows | 91 |
| Joel Emard | Asia | Opera | Windows | 38 |
| Margot Wuckert | North America | Opera | Ubuntu | 66 |
| Haley Klocko | South America | Firefox | iOS | 21 |
| Moses Conroy | Antarctica | Internet Explorer | Ubuntu | 99 |
| Cristal Maggio | Asia | Chrome | Ubuntu | 31 |
| Shea Howe | North America | Safari | Mac OS | 54 |
| 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 |