You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/config/js_kanban_cardheight_config.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@ cardHeight?: number; // px
19
19
:::important
20
20
If you combine the [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) and [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) settings, don't forget to specify a static height for cards via the `cardHeight` property. Unless you specify it, the cards will not be displayed.
21
21
When you use [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) with [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md), you should also fix the height of cards via the `cardHeight` property. Although a variable height of cards is supported for this type of layout, it may not work in a stable manner with custom card content.
22
+
23
+
If `cardHeight` is not specified, the widget falls back to an experimental approximation of card heights based on the visible fields declared in [`cardShape`](api/config/js_kanban_cardshape_config.md). With a custom [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md), this approximation does not apply — in that case, either set `cardHeight` explicitly or supply a custom [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) function.
Copy file name to clipboardExpand all lines: docs/api/config/js_kanban_columnshape_config.md
+34-14Lines changed: 34 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,10 +30,10 @@ columnShape?: {
30
30
},
31
31
fixedHeaders?: boolean,
32
32
css?: (column, cards) => string,
33
-
headerTemplate?:template(column=> {
33
+
headerTemplate?:template(props=> {
34
34
return"The HTML template of the column header in the expanded state";
35
35
}),
36
-
collapsedTemplate?:template(column=> {
36
+
collapsedTemplate?:template(props=> {
37
37
return"The HTML template of the column header in the collapsed state";
38
38
}),
39
39
confirmDeletion?: boolean
@@ -94,8 +94,28 @@ To configure the columns appearance, in the **columnShape** object you can speci
94
94
95
95
-`fixedHeaders` - (optional) freezes column headers during vertical scroll (*true* by default). Scroll must be enabled in Kanban itself (height must be limited)
96
96
-`css` - (optional) a function that returns a css class that applies to columns conditionally
97
-
-`headerTemplate` - (optional) the HTML template of the column header in the expanded state
98
-
-`collapsedTemplate` - (optional) the HTML template of the column header in the collapsed state
97
+
-`headerTemplate` - (optional) the HTML template of the column header in the expanded state. The function receives a `props` object with the following properties:
98
+
-`column` - (object) the column data (see [`columns`](api/config/js_kanban_columns_config.md) for the structure)
99
+
-`columnState` - (object) the current state of the column. It always includes:
100
+
-***columnId*** - (string | number) the ID of the column
101
+
-***column*** - (object) the column data (same as `props.column`)
102
+
-***cardsCount*** - (number) the number of cards in the column
103
+
-***noFreeSpace*** - (boolean) ***true*** when the column cannot accept more cards
104
+
105
+
When the [`columns[i].limit`](api/config/js_kanban_columns_config.md) parameter is enabled, it also includes:
106
+
-***totalLimit*** - (number) the configured cards limit
107
+
-***isOverLimit*** - (boolean) ***true*** when the number of cards exceeds the limit
108
+
109
+
When the column belongs to a swimlane (row), it also includes:
110
+
-***rowId*** - (string | number) the ID of the row
111
+
-***row*** - (object) the row data (see [`rows`](api/config/js_kanban_rows_config.md) for the structure)
112
+
-***height*** - (number) the height of the area
113
+
-`isMenuVisible` - (boolean) ***true*** when the menu should be shown for this column header
114
+
-`renaming` - (boolean) ***true*** when the input for editing the column name is active
115
+
-`readonly` - (boolean) ***true*** when column editing is disabled (equivalent of `!readonly.edit`, see the [`readonly`](api/config/js_kanban_readonly_config.md) property)
116
+
-`collapsedTemplate` - (optional) the HTML template of the column header in the collapsed state. The function receives a `props` object with the following properties:
117
+
-`column` - (object) the column data (see [`columns`](api/config/js_kanban_columns_config.md))
118
+
-`columnState` - (object) the current state of the column. The shape is the same as `columnState` in the [`headerTemplate`](#parameters) parameter above
99
119
-`confirmDeletion` - (optional) shows/hides the **confirmation dialog** that allows users to confirm or decline the column deletion
Copy file name to clipboardExpand all lines: docs/api/config/js_kanban_editorshape_config.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ editorShape?: [
19
19
type: string,
20
20
key: string,
21
21
label?: string,
22
+
modalSection?:"left"|"right",
22
23
23
24
// for the "dateRange" type only
24
25
key: {
@@ -182,6 +183,9 @@ In the Kanban editor you can use the following types of fields: **dateRange**, *
182
183
~~~
183
184
184
185
-`label`- (optional) an editor field label
186
+
-`modalSection`- (optional) defines in which column of the modal editor the field is placed. Applied only when the editor is shown as a modal window via the [`editor.placement: "modal"`](api/config/js_kanban_editor_config.md) property. The possible values are:
187
+
-`"left"`- the field is placed in the left column
188
+
-`"right"`- the field is placed in the right column (default)
185
189
186
190
#### - Parameters for a "dateRange" type
187
191
@@ -466,6 +470,7 @@ new kanban.Kanban("#root", {
466
470
467
471
- The ***dateRange*** type was added in v1.3
468
472
- The ***comments*** and ***links*** types of editor, and ***format*** parameters were added in v1.4
473
+
- The ***modalSection*** parameter was added in v1.6
469
474
- The ***clearButton*** parameter was replaced with the ***clear*** parameter
description: You can learn about the getCardHeight config in the documentation of the DHTMLX JavaScript Kanban library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Kanban.
5
+
---
6
+
7
+
# getCardHeight
8
+
9
+
### Description
10
+
11
+
@short: Optional. A function that returns an estimated height of a card
12
+
13
+
The `getCardHeight` function is used by the widget to estimate card heights when the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property is not set and the board is configured with [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) and [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md). The estimated heights let the widget render the scrollbar correctly before the actual cards are measured in the DOM.
14
+
15
+
:::info
16
+
If you set the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property, the widget uses the fixed height and `getCardHeight` is not called. Setting `cardHeight` is the recommended way to combine `renderType: "lazy"` with `scrollType: "column"`.
The callback function takes the following arguments:
28
+
29
+
-`cardShape` - the configuration object of the card (the [`cardShape`](api/config/js_kanban_cardshape_config.md) property)
30
+
-`card` - the data object of the card
31
+
-`cardWidth` - the current width of the card in pixels
32
+
33
+
The function must return a number — the estimated height of the card in pixels.
34
+
35
+
### Default config
36
+
37
+
By default, the widget uses a built-in function that approximates card height based on the visible fields declared in [`cardShape`](api/config/js_kanban_cardshape_config.md) and the data stored in the card. This default works for boards that rely on the built-in card layout.
38
+
39
+
If you provide a custom [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md), the built-in approximation can no longer predict the actual height of the rendered markup. In this case, specify a custom `getCardHeight` function that returns the height of the rendered template, or set a static [`cardHeight`](api/config/js_kanban_cardheight_config.md) instead.
40
+
41
+
### Example
42
+
43
+
The example below provides a custom `getCardHeight` function for a board with a custom card template:
If you combine the `renderType: "lazy"` and [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) settings, don't forget to specify a static height for cards via the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property. Unless you specify it, the cards will not be displayed correctly.
25
25
When you use `renderType: "lazy"` with [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md), you should also fix the height of cards via the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property. Although a variable height of cards is supported for this type of layout, it may not work in a stable manner with custom card content.
26
+
27
+
If `cardHeight` is not set, the widget falls back to an experimental approximation of card heights based on [`cardShape`](api/config/js_kanban_cardshape_config.md). For boards with a custom [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md), supply a custom [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) function instead.
Copy file name to clipboardExpand all lines: docs/api/config/js_kanban_scrolltype_config.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,8 @@ scrollType: "default"
29
29
:::important
30
30
If you combine the [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) and `scrollType: "default"` settings, don't forget to specify a static height for cards via the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property. Unless you specify it, the cards will not be displayed.
31
31
When you use [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) with `scrollType: "column"`, you should also fix the height of cards via the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property. Although a variable height of cards is supported for this type of layout, it may not work in a stable manner with custom card content.
32
+
33
+
If `cardHeight` is not set, the widget falls back to an experimental approximation of card heights based on [`cardShape`](api/config/js_kanban_cardshape_config.md). For boards with a custom [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md), supply a custom [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) function instead.
0 commit comments