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 |
|---|---|---|---|---|
| Elsa Kling | Asia | Chrome | iOS | 90 |
| Sylvia Harvey | Africa | Firefox | Ubuntu | 16 |
| Diego Balistreri | Australia | Chrome | Android | 35 |
| Dock Mills | South America | Firefox | Windows | 80 |
| Javier Senger | North America | Firefox | Android | 38 |
| Emmitt Mills | South America | Safari | Android | 45 |
| Justyn Kunde | Australia | Internet Explorer | Mac OS | 97 |
| Nedra Larkin | North America | Safari | Mac OS | 18 |
| Blanche Gleichner | Africa | Chrome | Android | 24 |
| Marcelina Ortiz | South America | Opera | iOS | 2 |
| Connie Wunsch | Australia | Firefox | Ubuntu | 54 |
| Monique Mills | Asia | Firefox | Mac OS | 67 |
| Jovani Schumm | Asia | Firefox | Ubuntu | 40 |
| Elbert Hessel | South America | Firefox | iOS | 75 |
| Joseph Smith | Africa | Opera | Ubuntu | 45 |
| Wayne Grimes | Australia | Internet Explorer | iOS | 90 |
| Joan Weissnat | Australia | Safari | Mac OS | 53 |
| Jermaine Howe | Antarctica | Safari | Windows | 16 |
| Madisyn Daugherty | Africa | Internet Explorer | Mac OS | 76 |
| Claudie Gleichner | Africa | Safari | Android | 34 |
| Sigmund Conn | Africa | Firefox | Android | 36 |
| Lazaro Torphy | Africa | Opera | Mac OS | 60 |
| Soledad Macejkovic | Europe | Internet Explorer | Mac OS | 99 |
| Forrest Oberbrunner | Australia | Safari | Android | 35 |
| Ardith Kertzmann | North America | Safari | Ubuntu | 26 |
| Jairo Weber | South America | Safari | Android | 11 |
| Victoria Feil | Australia | Chrome | Mac OS | 60 |
| Kadin Walter | North America | Safari | Mac OS | 32 |
| Maverick Reynolds | North America | Internet Explorer | Android | 14 |
| Carlie Dare | Antarctica | Safari | Android | 26 |
| Pat Kemmer | Africa | Firefox | Ubuntu | 70 |
| Delfina Heller | Antarctica | Internet Explorer | iOS | 90 |
| Greyson Kovacek | Australia | Safari | Ubuntu | 3 |
| Palma Hoeger | Australia | Opera | Android | 7 |
| Tina Kozey | North America | Firefox | Ubuntu | 100 |
| Vita Morissette | Australia | Opera | Ubuntu | 26 |
| Waino Quitzon | South America | Firefox | Android | 58 |
| Hillard Shanahan | South America | Edge | Windows | 64 |
| Bessie Cartwright | Europe | Internet Explorer | Ubuntu | 24 |
| Daren Cremin | Asia | Firefox | Android | 30 |
| Fannie Kerluke | South America | Firefox | Mac OS | 5 |
| Abelardo Osinski | Africa | Firefox | iOS | 12 |
| Vida Keebler | North America | Internet Explorer | Ubuntu | 36 |
| Pattie Kris | Australia | Safari | Mac OS | 76 |
| Terrill Hoeger | Australia | Safari | Ubuntu | 41 |
| Sydni Murazik | North America | Internet Explorer | Ubuntu | 61 |
| Kaitlyn Monahan | South America | Firefox | Android | 90 |
| Timmy Casper | Asia | Internet Explorer | Mac OS | 6 |
| Tessie Cummings | North America | Opera | Ubuntu | 71 |
| Elinor Connelly | Europe | Edge | iOS | 25 |
| Marguerite Yost | Antarctica | Safari | iOS | 22 |
| Rhea Christiansen | Europe | Safari | Mac OS | 94 |
| Adolfo Cormier | Europe | Edge | iOS | 34 |
| Orlando Sporer | Asia | Firefox | Mac OS | 18 |
| Coby Streich | Asia | Opera | Android | 15 |
| Spencer Cremin | Africa | Opera | Mac OS | 84 |
| Eliza Wolf | Australia | Opera | Android | 46 |
| Isaac Kiehn | South America | Firefox | Windows | 64 |
| Presley Kassulke | Asia | Opera | Ubuntu | 54 |
| Malinda Muller | Africa | Opera | Android | 44 |
| Anabelle Bednar | Australia | Safari | Mac OS | 5 |
| Elouise McDermott | North America | Safari | iOS | 62 |
| Kenna Lang | North America | Internet Explorer | iOS | 83 |
| Eldora Pfannerstill | North America | Chrome | Windows | 84 |
| Josefa Spencer | South America | Opera | Android | 87 |
| Hildegard Jacobs | Africa | Internet Explorer | iOS | 39 |
| Candido Hessel | Australia | Internet Explorer | Android | 85 |
| Marlin Harris | Asia | Opera | Android | 58 |
| Humberto Farrell | South America | Chrome | Mac OS | 56 |
| Maddison Powlowski | Africa | Internet Explorer | Android | 34 |
| Sammie Kshlerin | South America | Safari | Windows | 73 |
| Maymie Muller | South America | Safari | Android | 55 |
| Orville Ziemann | Asia | Firefox | Android | 97 |
| Marcus Gibson | Africa | Safari | Mac OS | 22 |
| Destiny Schmeler | Europe | Chrome | Ubuntu | 6 |
| Electa Ziemann | North America | Firefox | Mac OS | 39 |
| Ada Padberg | South America | Safari | Mac OS | 95 |
| Kaya Keeling | Asia | Internet Explorer | Windows | 6 |
| Howell Swaniawski | Asia | Opera | iOS | 54 |
| Frieda Nolan | South America | Internet Explorer | iOS | 34 |
| Katlyn Armstrong | North America | Internet Explorer | Ubuntu | 14 |
| Cole Sipes | South America | Opera | Ubuntu | 65 |
| Toni Crona | Africa | Edge | Mac OS | 88 |
| Josefina Glover | North America | Opera | Ubuntu | 35 |
| Phyllis Upton | Australia | Internet Explorer | Ubuntu | 74 |
| Evalyn Schowalter | North America | Safari | Android | 45 |
| Mathew Leffler | Europe | Edge | Android | 73 |
| Kris Yundt | Australia | Internet Explorer | Mac OS | 80 |
| Nathen Mitchell | South America | Internet Explorer | Mac OS | 16 |
| Marcelle Beatty | Africa | Internet Explorer | Android | 44 |
| Ned Farrell | Africa | Firefox | Mac OS | 24 |
| Ryleigh Skiles | South America | Opera | Android | 87 |
| Skye Kilback | Europe | Safari | Ubuntu | 59 |
| Blake Macejkovic | South America | Chrome | Mac OS | 59 |
| Peter Fadel | Australia | Internet Explorer | Android | 27 |
| Marietta Borer | Asia | Firefox | iOS | 65 |
| Daisha Konopelski | Antarctica | Firefox | iOS | 50 |
| Mazie Fritsch | Australia | Opera | Android | 33 |
| Johnny Ullrich | Africa | Opera | Ubuntu | 59 |
| Cassie Schowalter | Africa | Internet Explorer | Ubuntu | 76 |
| 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 |