new Grid(id, properties) → {Object}
Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the component. |
properties |
Object
|
HTMLElement
|
The properties used to initialize the component or the container element. |
Properties:
- Mixes In:
Returns:
An instance of the component.
-
Type
-
Object
Extends
Classes
- Column
- ColumnGroup
- GridEvents
- Item
Members
clearSelectionOnOutsideClick :Boolean
Gets or sets a value indicating whether the selection should be cleared on a click outside the grid.
Type:
Gets or sets the column groups.
Type:
Gets or sets the column sorting option.
Type:
Gets or sets the columns.
Type:
contentHeight :String
Gets or sets the height of the content container.
Type:
contentStyle :String
Gets or sets the style of the content container.
Type:
cssClassCheckBox :String
Gets or sets the css class of the check box.
Type:
cssClassContent :String
Gets or sets the css class of the content container.
Type:
Gets or sets the css class of the datapager.
Type:
cssClassDragGhost :String
Gets or sets the css class of the drag ghost.
Type:
cssClassExpand :String
Gets or sets the css class of the expand cell.
Type:
cssClassExpandIcon :String
Gets or sets the css class of the expand icon.
Type:
Gets or sets the css class of the filter button.
Type:
cssClassFilterFrom :String
Gets or sets the css class of the filter from label.
Type:
Gets or sets the css class of the filter menu.
Type:
cssClassFilterTo :String
Gets or sets the css class of the filter to label.
Type:
cssClassFixedColumn :String
Gets or sets the css class of a fixed column.
Type:
cssClassGroupHead :String
Gets or sets the css class of a group-item head.
Type:
cssClassGroupItem :String
Gets or sets the css class of a group-item.
Type:
Gets or sets the css class of the header container.
Type:
Gets or sets the css class of the header label.
Type:
cssClassHiddenColumn :String
Gets or sets the css class of a hidden column.
Type:
cssClassItem :String
Gets or sets the css class of the item.
Type:
cssClassNoResult :String
Gets or sets the css class of the no result container.
Type:
cssClassPreloader :String
Gets or sets the css class of the preloader.
Type:
cssClassResizeHandle :String
Gets or sets the css class of the resize handle.
Type:
Gets or sets the id of the datapager.
Type:
Gets or sets a value indicating whether column headers are draggable.
Type:
draggableItems :Boolean
Gets or sets a value indicating whether data items are draggable.
Type:
Gets or sets a value indicating whether the data pager is enabled.
Type:
enableExpandColumn :Boolean
Gets or sets a value indicating whether the expand column is enabled.
Type:
enableFilterRow :Boolean
Gets or sets a value indicating whether the filter row is enabled.
Type:
Gets or sets a value indicating whether the tooltip manager is enabled.
Type:
Type:
filterBetweenLabels :Array.<String>
Gets or sets the filter from and to labels (0: FROM, 1: TO).
Type:
Gets or sets the id of the filter menu.
Type:
Gets or sets friendly labels for filter menu options (EQUALTO, NOTEQUALTO, GREATERTHAN, GREATERTHANOREQUALTO, LESSTHAN, LESSTHANOREQUALTO, STARTSWITH, NOTSTARTSWITH, ENDSWITH, NOTENDSWITH, CONTAINS, NOTCONTAINS, BETWEEN, NOTBETWEEN, IN, NOTIN, EMPTY, NOTEMPTY)
Type:
Gets or sets the time in milliseconds between a horizontal scrolling action and updating the position of fixed columns accordingly (defaults to 100).
Type:
fixedColumns :Number
Gets or sets the amount of fixed columns at the left side of the grid which remain visible while scrolling horizontally.
Type:
Gets or sets the item-group expansion option.
Type:
groupIndent :Number
Gets or sets the indent value of an item-group in pixels (defaults to 10).
Type:
Gets or sets the drag settings for the draggable headers.
Type:
Gets or sets the resize settings for the resizable headers.
Type:
Gets or sets the drag settings for the draggable items.
Type:
Gets or sets the list of items.
Type:
itemTemplateId :String|null
Gets or sets the default template id of an item.
Type:
preserveTotalWidth :Boolean
Gets or sets a value indicating if the total width of the grid view is preserved when resizing a column. When enabled, resizing a column header will not change the total width of the grid, instead the change in width will be distributed over all resizable columns.
Type:
Gets or sets a value indicating whether column headers are resizable.
Type:
Gets or sets the row expansion option.
Type:
Gets or sets the row selection option.
Type:
Gets or sets the select settings for the selectable items.
Type:
Gets or sets the id of the tooltip manager used to display tooltips.
Type:
useViewportHeight :Boolean
Gets or sets a value indicating whether the viewport height is utilized for the content container. The height calculation respects a possible bottom margin of the grid element.
Type:
viewportBottomOffset :Number
Gets or sets the bottom offset in pixels for the viewport height. Only applicable when useViewportHeight is enabled.
Type:
(static, readonly) ColumnSortingOption :number
Type:
Properties:
| Name |
Type |
Description |
NONE |
number
|
|
SINGLE |
number
|
|
MULTI |
number
|
|
Type:
Properties:
| Name |
Type |
Description |
TEXTBOX |
number
|
|
NUMERICBOX |
number
|
|
COMBOBOX |
number
|
|
DATEPICKER |
number
|
|
TIMEPICKER |
number
|
|
SLIDER |
number
|
|
Type:
Properties:
| Name |
Type |
Description |
EQUALTO |
number
|
|
NOTEQUALTO |
number
|
|
GREATERTHAN |
number
|
|
GREATERTHANOREQUALTO |
number
|
|
LESSTHAN |
number
|
|
LESSTHANOREQUALTO |
number
|
|
STARTSWITH |
number
|
|
NOTSTARTSWITH |
number
|
|
ENDSWITH |
number
|
|
NOTENDSWITH |
number
|
|
CONTAINS |
number
|
|
NOTCONTAINS |
number
|
|
BETWEEN |
number
|
|
NOTBETWEEN |
number
|
|
IN |
number
|
|
NOTIN |
number
|
|
EMPTY |
number
|
|
NOTEMPTY |
number
|
|
getName |
number
|
|
(static, readonly) GroupExpansionOption :number
Type:
Properties:
| Name |
Type |
Description |
NONE |
number
|
|
ICON |
number
|
|
ITEM |
number
|
|
(static, readonly) RowExpansionOption :number
Type:
Properties:
| Name |
Type |
Description |
NONE |
number
|
|
SINGLE |
number
|
|
MULTI |
number
|
|
(static, readonly) RowSelectionOption :number
Type:
Properties:
| Name |
Type |
Description |
NONE |
number
|
|
SINGLE |
number
|
|
MULTI |
number
|
|
(static, readonly) SortOrderOption :number
Type:
Properties:
| Name |
Type |
Description |
ASC |
number
|
|
DESC |
number
|
|
Methods
cancelSelectClick()
Disables selection on elements for the current click event. Selection is automatically re-enabled when the current event bubbles to the document click.
collapseItem(id)
Collapses the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
collapseItemGroup(id)
Collapses the item-group with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
deselectItem(id)
Deselects the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
deselectItems(ids)
Deselects the items with the specified id.
Parameters:
| Name |
Type |
Description |
ids |
Array
|
The list of item ids. |
destroy()
- See:
-
disableItem(id)
Disables the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
enableItem(id)
Enables the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
expandItem(id)
Expands the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
expandItemGroup(id)
Expands the item-group with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
filter(columns, autoLoadopt, clearopt)
Parameters:
| Name |
Type |
Attributes |
Description |
columns |
Object
|
|
Plain Object with column id as key and a Plain Object as value.
The value Object properties:
value (String): The filter value.
[type] (FilterMenuOptions): One or more of the options.
[updateInput] (Boolean): Value indicating if the corresponding filter input value should be updated (default true). |
autoLoad |
Boolean
|
<optional>
|
Defines if the grid should reload data. |
clear |
Boolean
|
<optional>
|
Defines if the current selection should be cleared. |
getColumn(id)
Returns the grid column with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The column id. |
getColumnGroup(id)
Returns the grid column group with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The column id. |
getColumnGroupIndex(id)
Returns the grid column group index with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The column id. |
getColumnIndex(id)
Returns the grid column index with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The column id. |
getItem(id)
Returns the grid item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The item id. |
hideColumn(id)
Hides a column in the grid.
Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the column. |
hideColumnGroup(id)
Hides a columnGroup in the grid.
Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the columnGroup. |
load(clearopt, pageIndexopt)
Parameters:
| Name |
Type |
Attributes |
Description |
clear |
Boolean
|
<optional>
|
Defines if the current selection should be cleared. |
pageIndex |
Number
|
<optional>
|
Defines which page index to load. |
postRender()
Handles the post render procedure.
removeColumn(id)
Removes a column from the grid.
Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the column. |
removeColumnGroup(id)
Removes a column group header from the grid.
Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the column group. |
removeItem(id)
Removes the grid item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
The item id. |
render()
renderItem(item)
Renders the specified item by creating a new table record or overwriting the existing table record in the grid.
The item must exist in the item list and the item's position in the item group will equal the item's position within the item list.
Parameters:
selectItem(id)
Selects the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
selectItems(ids)
Selects the items with the specified id.
Parameters:
| Name |
Type |
Description |
ids |
Array
|
The list of item ids. |
selectable()
Returns the selectable object which enables grid table elements to be selectable.
setItemPreloaderTemplate(content)
Sets the item preloader template.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
The content template. Pass null or empty string to remove the existing template. |
setNoResultTemplate(content)
Sets the no result template.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
The content template. Pass null or empty string to remove the existing template. |
setPreloaderTemplate(content)
Sets the preloader template.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
The content template. Pass null or empty string to remove the existing template. |
showColumn(id)
Shows a column in the grid.
Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the column. |
showColumnGroup(id)
Shows a columnGroup in the grid.
Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the columnGroup. |
sort(columns, autoLoadopt, clearopt)
Parameters:
| Name |
Type |
Attributes |
Description |
columns |
Object
|
|
Object with column id as key and one of the options from componyx.UI.Grid.SortOrderOption as value. |
autoLoad |
Boolean
|
<optional>
|
Defines if the grid should reload data. |
clear |
Boolean
|
<optional>
|
Defines if the current selection should be cleared. |
suppressNextChangeEvent(action)
Suppresses any change events fired by the underlying input element during the execution of the provided action. Use this when programmatically setting a component value to prevent the change event from propagating as a user interaction.
The suppression is automatically lifted after the action completes, even if it throws.
Parameters:
| Name |
Type |
Description |
action |
function
|
The action to execute with change events suppressed. |
- Mixes In:
toggleExpandItem(id)
Expands/collapses the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
toggleExpandItemGroup(id)
Expands/collapses the item-group with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
toggleSelectItem(id)
Selects/deselects the item with the specified id.
Parameters:
| Name |
Type |
Description |
id |
String
|
Item id |
Type Definitions
GridAjaxEventArgs
Type:
Properties:
| Name |
Type |
Description |
Grid |
componyx.UI.Grid
|
The Grid instance. |
eventArgs |
Object
|
undefined
|
The ajax result arguments, undefined when no ajax load method is defined (item-list events only).
Properties
| Name |
Type |
Description |
data |
string
|
Object
|
The response data. |
|
GridColumnOrderEventArgs
Type:
Properties:
| Name |
Type |
Description |
Grid |
componyx.UI.Grid
|
The Grid instance. |
eventArgs |
Object
|
The event object containing more detailed information about the event.
Properties
| Name |
Type |
Description |
sourceIndex |
number
|
The original column index. |
targetIndex |
number
|
The new column index. |
|
GridColumnResizeEventArgs
Type:
Properties:
| Name |
Type |
Description |
Grid |
componyx.UI.Grid
|
The Grid instance. |
eventArgs |
Object
|
The event object containing more detailed information about the event.
Properties
| Name |
Type |
Description |
columnIndex |
number
|
The column index. |
element |
HTMLElement
|
The resized header element. |
|
GridColumnSortEventArgs
Type:
Properties:
| Name |
Type |
Description |
Grid |
componyx.UI.Grid
|
The Grid instance. |
eventArgs |
Object
|
The event object containing more detailed information about the event.
Properties
|
GridEventArgs
Type:
Properties:
GridItemEventArgs
Type:
Properties:
| Name |
Type |
Description |
Grid |
componyx.UI.Grid
|
The Grid instance. |
eventArgs |
Object
|
The event object containing more detailed information about the event.
Properties
| Name |
Type |
Description |
item |
componyx.UI.Grid.Item
|
The grid item. |
tr |
HTMLTableRowElement
|
The table row of the item. |
td |
HTMLTableCellElement
|
null
|
The group-head cell (item-group expand/collapse) or the expand content cell (item expand), otherwise null. |
event |
Event
|
The original event object. |
|
GridItemOrderEventArgs
Type:
Properties:
| Name |
Type |
Description |
Grid |
componyx.UI.Grid
|
The Grid instance. |
eventArgs |
Object
|
The event object containing more detailed information about the event.
Properties
| Name |
Type |
Description |
items |
Array.<componyx.UI.Grid.Item>
|
The moved items (a group item includes its child items). |
fromIndex |
number
|
The original item index. |
toIndex |
number
|
The target item index. |
resultIndex |
number
|
The resulting index after the move. |
dropZone |
HTMLElement
|
The drop zone (table row) the items were dropped on. |
nextRow |
HTMLElement
|
null
|
The row before which the items were inserted, null when appended at the end. |
|
GridQueryEventArgs
Type:
Properties:
| Name |
Type |
Description |
Grid |
componyx.UI.Grid
|
The Grid instance. |
eventArgs |
Object
|
The load query.
Properties
| Name |
Type |
Description |
sortOrder |
Object.<string, componyx.UI.Grid.SortOrderOption>
|
The sort order per column id. |
filter |
Object
|
The active filter. |
pageIndex |
number
|
The page index (1-based). |
|