Page size selector is saved to localStorage if id is specified.
string
data
Defines datagrid data. If no data is given, empty state is displayed.
array
[]
bordered
Adds border to the datagrid component
boolean
false
loading
If true, shows the loading state. It will disappear when server side data has been loaded or when the attribute/property removed manually
boolean
false
auto-focus
If true, focus the search input when datagrid is loaded.
boolean
false
action-type
Defines the button type
string
"primary"
sorting-key
Defines the field on the data that will be used for sorting.
string
sorting-order
If sorting-key is set this attribute defines the sorting order
"asc" | "desc"
"asc"
search-keysDeprecated
Please use `search-includes` and `search-exclude` attributes insetead of this. Defines which fields will be used for searching. If not set, all rendered columns are used.
array
[]
search-includes
Defines which fields extends the rendered columns in searching.
array
[]
search-tooltip
Overrides default tooltip on search field.
string
search-keyword
Defines default search keyword
string
search-hidden
If true, removes search input from header.
boolean
false
pagination-hidden
If true, removes pagination and shows all data in one page
boolean
false
page-size
Sets the number of displayed rows shown on one page.
string
page-size-hidden
If true, remove page size selector
boolean
false
server
Defines the url where data comes from. If server responds with error, empty state is displayed.
string
server-error-state
If true, shows the server error state. It will disappear when data has been set or when the attribute/property removed manually
boolean
false
server-select-all-visible
If true, there will be "Select all" and "Clear selection" options on the bulk selection toolbar even if the datagrid uses server side pagination. In this case after a "Select all" the isSelectionInverted property will be true on the trigger event of the bulk action and the data will contain the unselected items. The id-key attibute also has to be set in order to work.
boolean
false
id-key
Defines which property on the rows can serve as an identifier for matching rows in selection with the data from server. If it is not set, selection will be cleared when the content changes.
string
customServer
A function that acts like the server. A promise or object must be returned in the same format you would answer for the server one. See the example below (example)
function
horizontal-scroll-disabled
If true, disable horizontal scrolling and the content must use the space available.
boolean
false
highlighted-key
Defines which property on the rows can serve as an identifier for highlighting.
string
JavaScript API
Name
Type
Description
Arguments
selectedItems
Gets or sets the list of items that are selected by bulk actions
Gets new data from server if datagrid uses the server or the customServer options
*: An array of entire objects for items in the data of the datagrid, with all their
fields, or if there is an id (unique) field that can be passed too on its own as seen in the example below:
Fires when page size is changed via the page size selector.
{
detail: {
value: [new value]
}
}
sort
Fires when sorting on the column is changed
{
detail: {
contentKey,
order: ['asc'|'desc']
}
}
select
Fires when selecting an item in bulk mode
{
detail: {
selectedItems
}
}
API Reference e-datagrid-action
Defines the table action(s). If you insert multiple instances of the component, the first will the the primary, additional actions will be available in the dropdown. If you add 2 actions, the first action will be the primary button, the second action
will be a regular button.
Properties
Name
Description
Type
Required
Default value
label
Defines the label of the action.
string
true
disabled
Disables action.
boolean
false
disabled-tooltip
Defines tooltip for disabled actions.
string
disabled-type
If you want to show permission information in tooltip, use this attribute
- | "permission"
url
Defines the url of the link
string
dialog
Defines the query selector of dialog which can be opened on action click
string
-
target
Defines the target context of the linked URL
string
Events
Event
Description
Returns
trigger
Fires on the component when the action is clicked.
{}
API Reference e-datagrid-column
Properties
Name
Description
Type
Required
Default value
head
Defines column header.
string
true
content-key
Defines relation between data and column.
string
true
width
Defines the width of the column, it can be any unit (% is preferred)
string
no-wrap
Disables column wrapping
boolean
false
render-html
Enables HTML parsing for rendering HTML content in the column.
The value passed is sanitized automatically against XSS attacks
boolean
false
sortable
Enables column sortable.
boolean
true
tooltip
Renders helper tooltip next to column header
string
order
Changes the order of the column
number
0
default-width
Defines the default value of the width setting of the column
"narrow" | "wide"
search-exclude
Column will be not searchable if it is true.
boolean
false
hidden
Hides the column from the datagrid.
boolean
false
API Reference e-datagrid-column-numeric
Properties
Name
Description
Type
Required
Default value
type
Defines type of column. It affects format, alignment and behaviour (e.g. search).
Defines the currency if type is currency or currency-code.
string
"EUR"
humanize
Formats a number to a more human-readable string.
['auto'|k'|'m'|'b'|'t']
API Reference e-datagrid-column-priority
Properties
Name
Description
Type
Required
Default value
disabled-tooltip
Defines tooltip for disabled rows.
string
disabled-key
Defines disabled state based on the specified key for rows.
string
Events
Event
Description
Returns
trigger
Fires when the priority of a row is modified.
{
detail: {
data: [whole data of the datagrid with the actual priority]
targetRow: [the currently selected row with the actual priority]
}
}
finish
Fires when exit priority action is clicked.
{
detail: {
data: [whole data of the datagrid with the actual priority]
}
}
API Reference e-datagrid-column-time
Properties
Name
Description
Type
Required
Default value
type
Defines type of column. It affects format, alignment and behaviour (e.g. search). Content should be ISO Date when type is time, it should be integer (seconds) when type is duration.
"time" | "duration"
"time"
format
If type is time, it defines which part of the time will be displayed (the actual format depends on the config)
"date" | "datetime" | "ymd" | "ymdhis" | "ymdhi"
"datetime"
API Reference e-datagrid-column-switch
Properties
Name
Description
Type
Required
Default value
active-label
Label of active switch
string
"Active"
inactive-label
Label of inactive switch
string
"Inactive"
deactivate-tooltip
Tooltip of active switch
string
"Deactivate"
activate-tooltip
Tooltip of inactive switch
string
"Activate"
deactivating-label
Label is shown when deactivating is in progress
string
"Deactivating"
activating-label
Label is shown when activating is in progress
string
"Activating"
disabled
Disables action.
boolean
false
disabled-tooltip
Defines tooltip for disabled actions. It shows tooltip attribute if not specified.
string
disabled-tooltip-key
Defines tooltip text for disabled actions based on the specified key.
string
disabled-key
Defines disabled state based on the specified key.
string
disabled-type
If you want to show permission information in tooltip, use this attribute
- | "permission"
Events
Event
Description
Returns
trigger
Fires when the user uses the switch. Resolve should be called after handling the event (possibly with a request) or reject if there was an error.
Defines tooltip for disabled actions. It shows tooltip attribute if not specified.
string
disabled-tooltip-key
Defines tooltip for disabled actions based on the specified key.
string
disabled-key
Defines disabled state based on the specified key.
string
disabled-type
If you want to show permission information in tooltip, use this attribute
- | "permission"
visible-key
Defines visibility state based on the specified key. Action show only where the value is true.
string
url-key
Defines url of link based on the specified key.
string
order
Changes the order of the item actions
number
0
target
Defines the target context of the linked URL
string
loading-key
Defines loading state based on the specified key.
string
Events
Event
Description
Returns
trigger
Fires on action click in rows.
{
detail: {
data: [data row]
}
}
API Reference e-datagrid-bulk-action
Properties
Name
Description
Type
Required
Default value
icon
Defines the icon.
string
label
Defines the label of the action.
string
true
disabled
Disables the action.
boolean
false
disabled-tooltip
Defines the tooltip around the action when disabled.
string
Events
Event
Description
Returns
trigger
Fires on action click. The isSelectionInverted will be true only if the datagrid uses server side pagination and the user used "Select all" and there was no "Clear selection" after that.
This should be the same value that came with the request that you answering.
content
array
The same object what you would pass to the datagrid with its data property.
itemCount
number
The total number of rows without filtering applied.
filteredItemCount
number
The number of rows with filtering applied.
Custom Server Example
Instead of the server property, you can use a customServer function, so you have absolute control over what should happen when something changes in the datagrid.