Overview
To help you understand every section, we have created a live demo for each DkGrid feature.
Last updated
To help you understand every section, we have created a live demo for each DkGrid feature.
Last updated
We have deployed all the DkGrid features as live examples. We describe every DkGrid part showing a code snippet from its corresponding live demo.
A live-demo link looks as follows:
live example.
When navigating the live examples, you can change the Theme and Scheme at run time. The following themes are available in light
and dark
schemes:
default
blue, amber, red
brand
dikesoft-blue, amber, red
indigo
indigo, pink, red
deep-purple
deep-purple, amber, red
pink
pink, blue-gray, red
purple
purple, amber, red
custom-green
green, yellow, red
We have used Tailwind CSS to generate all the above themes and schemes. We also use the predefined classes offered by Tailwind CSS.
As you can change the Theme and the Scheme, you can also change some DkGrid properties when interacting with the live examples.
The following are all the properties you can change. These properties feed the corresponding DkGrid properties.
Grid Width
The DkGrid's width.
auto
Required
Grid Height
The DkGrid's height.
500px
Required
Material Elevation
Indicates if the DkGrid will express elevation.
true
Elevation value
The elevation value the DkGrid will take.
2
Required Min value: 0 Max value: 24 Only numbers
Vertical Row Lines
Indicates if the lines that separate every column value will be shown.
false
Striped
Indicates if one row will be distinguished from the other.
true
Column Context Menu
It allows showing or hiding the context menu for all the DkGrid columns.
true
Header Height
Sets the height, in pixels, for every column header.
60
Required Min value: 40 Max value: 120 Only numbers
Allow column dragging
A flag that indicates if the DkGrid allows its columns to be dragged.
false
Row Id
A flag that allows displaying the id of every row.
false
Column Id width
Establishes the width, in pixels, of the column that displays the Row Id.
70
Required Min value: 50 Max value: 100 Only numbers
Content Row Height
Establishes the height, in pixels, of every displayed row.
50
Required Min value: 45 Max value: 80 Only numbers
Row Grouping Height
The height, in pixels, of the panel where the columns are displayed, which the DkGrid is grouped by.
71
Required Min value: 50 Max value: 100 Only numbers
Columns Height
The height, in pixels, of every column that is displayed in the Row-Grouping panel.
36
Required Min value: 30 Max value: 80 Only numbers
Row Grouping Indent
A flag that allows displaying or hiding the indentation of every row under a group.
true
Indent width
The width, in pixels, of the indentation every row under a group will have.
25
Required Min value: 25 Max value: 150 Only numbers
Allow sorting
Indicates if the DkGrid will allow or not that its rows could be ordered.
false
Row Filter
The flag that allows if the row, under the headers, will be shown.
false
Row Filter Height
The height, in pixels, that the row filter will have.
55
Required Min value: 45 Max value: 80 Only numbers
On-Demand filter
This flag allows filtering rows until the user sends the conditions by clicking the corresponding button.
false
Allow selection
The flag that allows that every row could be selected.
false
Edition mode
This flag is used to enable or disable the rows edition, if the DkGrid allows edition as well.
false
Edition Toolbar
This flag allows displaying or hiding the edition toolbar.
false
Toolbar Height
The height, in pixels, that the Edition Toolbar will have.
55
Required Min value: 45 Max value: 100 Only numbers
Toolbar Item Height
The height, in pixels, of every option of the Edition Toolbar.
42
Required Min value: 36 Max value: 60 Only numbers
Toolbar position
The value indicates if the Edition Toolbar is shown at the top or bottom of the DkGrid.
bottom
Toolbar alignment
The value indicates if the Edition Toolbar is shown at the left, center or right.
left
Pagination
This flag allows paginating the data set.
false
Page size
The value indicates how many rows will be displayed for every page.
50
Required Min value: 1 Only numbers
Pagination Height
The height, in pixel, that the paginator will have.
64
Required Min value: 60 Max value: 100 Only numbers
While navigating the live examples, you will see a red square with white gear.
Clicking on the white gear will show a floating panel with all the themes, schemes, and DkGrid properties.
Remember that the DkGridConfig
service does not belong to the DkGridComponent
definition itself. It was created only for demo purposes.
As you can see in the DkGridConfig
definition, it has a public property called configChange
of type Observable<DkGridProperties>
. Therefore, If a live-demo feature should react to these properties changes, the corresponding DkGridComponent
instance must listen to the configChange
observable.
We have grouped all the properties in one type called DkGridProperties
, an Intersection type.
We have created these interfaces for demo purposes. Therefore, every property of these interfaces feeds the corresponding DkGridComponent
properties.
We generate sample data of 1000 rows or even more. The service SampleData
is responsible for this data generation.
The main interface is Employee
. This interface contains all the fields that we display in the live examples.
For a better experience reading this set of docs, we have taken some conventions:
Any type, even primitives, are highlighted in the text in green color. For example, Date
, string
, numeric
, DkGridComponent
, Employee
.
HTML selectors are highlighted in the text in red color. For example, div
, section
, dk-grid
, dk-grid-column
.
Properties for the dk-grid
and dk-grid-column
selectors are highlighted in text in orange color. For example, allowSorting
, sortable
, allowRowGrouping
, draggable
, filterable
.
Injection Tokens are highlighted in blue color. For example, HEADER_ROW_HEIGHT
, LOADING_MESSAGE
.
Visit the official docs for further details.
The DkGrid changes all the described properties through a service called DkGridConfig
. This service is responsible for delivering every property when changing one of them through the .
We have generated only five rows for the by hand.