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_cards_config.md
+46-19Lines changed: 46 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,17 +22,29 @@ cards?: [
22
22
start_date?:Date,
23
23
end_date?:Date,
24
24
attached?: [
25
-
id: string | number,
26
-
url?: string,
27
-
previewURL?: string,
28
-
coverURL?: string,
29
-
name?: string,
30
-
isCover?: boolean
25
+
{
26
+
id: string | number,
27
+
url?: string,
28
+
previewURL?: string,
29
+
coverURL?: string,
30
+
name?: string,
31
+
isCover?: boolean
32
+
}, {...}
31
33
],
32
34
color?: string,
33
35
users?: array,
34
36
priority?: string | number,
35
37
css?: string,
38
+
votes?: array,
39
+
comments?: [
40
+
{
41
+
id: string | number,
42
+
userId: string | number,
43
+
cardId: string | number,
44
+
text?: string,
45
+
date?:Date,
46
+
},{...}
47
+
],
36
48
[custom_key: string]?: any
37
49
},
38
50
{...} // other cards data
@@ -47,10 +59,10 @@ For each card you can specify the following parameters (data):
47
59
-`label` - (optional) a card label. It is displayed in the **Label** field
48
60
-`description` - (optional)a card description. It is displayed in the **Description** field
49
61
-`progress` - (optional) a progress bar value. You can specify the value in the range from 0 to 100 points. It is displayed in the **Progress bar** field
50
-
-`start_date` - (optional) a start date value. It is displayed in the **Start date** field
51
-
-`end_date` - (optional) an end date value. It is displayed in the **End date** field
52
-
-`attached` - (optional) an array with data of the attached file(s). It is displayed in the **Attachment** field. Here you can specify the following parameters:
53
-
- `id` - (required) an **ID** of the attached file
62
+
-`start_date` - (optional) a start Date object (do not specify a string date). It is displayed in the **Start date** field
63
+
-`end_date` - (optional) an end Date object (do not specify a string date). It is displayed in the **End date** field
64
+
-`attached` - (optional) an array of objects with data of the attached file(s). It is displayed in the **Attachment** field. For each object you can specify the following parameters:
65
+
- `id` - (required) an **ID** of the attached file
54
66
- `url` - (optional) a path to the file to be attached
55
67
- `previewURL` - (optional) a path to the preview image
56
68
- `coverURL` - (optional) a path to the image to be set as a cover
@@ -60,6 +72,13 @@ For each card you can specify the following parameters (data):
60
72
-`users` - (optional) an array with the assigned users **ID**s. To specify the assigned users, you need to define an array with users data in the [cardShape.users](../js_kanban_cardshape_config) property. The users are displayed in the **Users** field
61
73
-`priority` - (optional) a card priority **ID**. To specify the card priority, you need to define an array with priorities data in the [cardShape.priority](../js_kanban_cardshape_config) property. It is displayed in the **Priority** field
62
74
-`css` - (optional) defines css styles for a separate card
75
+
-`votes` - (optional) an array of user IDs
76
+
-`comments` - (optional) an array of objects with data of comments. For each comment's object you can specify the following parameters:
77
+
- `id` - (required) an **ID** of the comment
78
+
- `userId` - (required) an **ID** of a user that posted the comment
79
+
- `cardId` - (required) an **ID** of the card that the comment belongs to
80
+
- `text` - (optional) a text of the comment. It also can contain html markup
81
+
- `date` - (optional) a Date object (do not specify a string date). The date when the comment was posted. It is not updated after editing
63
82
-`custom_key` - (optional) a custom key of the card. You can specify the custom keys to place the card into column and row. See the [columnKey](../js_kanban_columnkey_config) and [rowKey](../js_kanban_rowkey_config) properties
64
83
65
84
:::info
@@ -68,15 +87,15 @@ If you want to load new data for cards dynamically, you can use the [**parse()**
68
87
69
88
### Example
70
89
71
-
~~~jsx {1-32,36}
90
+
~~~jsx {1-40,44}
72
91
constcards= [
73
92
{
74
93
id:1,
75
94
label:"Integration with React",
76
95
description:"Some description",
77
96
progress:25,
78
-
start_date:newDate("01/05/2021"),
79
-
end_date:newDate("01/15/2021"),
97
+
start_date:newDate("02/24/2022"),
98
+
end_date:newDate("02/24/2023"),
80
99
attached: [
81
100
{
82
101
id:234,
@@ -85,11 +104,20 @@ const cards = [
85
104
coverURL:"../assets/img-1.jpg",
86
105
name:"img-1.jpg",
87
106
isCover:true
88
-
},
89
-
{...} // other attached files data
107
+
}, {...} // other attached files data
90
108
],
91
109
color:"#65D3B3",
92
-
users: [1, 2],
110
+
users: [1,2],
111
+
votes: [3,6,8],
112
+
comments: [
113
+
{
114
+
id:1,
115
+
userId:1,
116
+
cardId:1,
117
+
text:"Greetings, fellow colleagues. I would like to share my insights on this task. I reckon we should deal with at least half of the points in the plan without further delays. ",
118
+
date:newDate(),
119
+
}, {...}
120
+
],
93
121
priority:1,
94
122
// custom field to place the card into the "feature" row
95
123
// the rowKey config needs to be set to the "type" value
@@ -98,8 +126,7 @@ const cards = [
98
126
// the columnKey config needs to be set to the "stage" value
99
127
stage:"backlog",
100
128
css:"red",
101
-
},
102
-
{...} // other cards data
129
+
},{...} // other cards data
103
130
];
104
131
105
132
newkanban.Kanban("#root", {
@@ -109,7 +136,7 @@ new kanban.Kanban("#root", {
109
136
});
110
137
~~~
111
138
112
-
**Change log:** The ***css*** parameter was added in v1.4
139
+
**Change log:** The ***css***, ***comments*** and ***votes*** parameters were added in v1.4
113
140
114
141
**Related articles:**
115
142
-[Working with data](../../../guides/working_with_data)
Copy file name to clipboardExpand all lines: docs/guides/working_with_data.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ description: You can explore how to work with Data in the documentation of the D
10
10
11
11
When initializing Kanban, you can provide the initial data for [**columns**](api/config/js_kanban_columns_config.md), [**cards**](api/config/js_kanban_cards_config.md), [**rows**](api/config/js_kanban_rows_config.md) and [**links**](api/config/js_kanban_links_config.md).
12
12
13
-
~~~jsx {1,17,70,83,95-98}
13
+
~~~jsx {1,17,81,94,106-109}
14
14
constcolumns= [ // data for columns
15
15
{
16
16
label:"Backlog",
@@ -39,10 +39,21 @@ const cards = [ // data for cards
39
39
end_date:newDate("01/15/2021"),
40
40
41
41
progress:25,
42
-
users: [1,2, 3, 4],
42
+
users: [1,2,3,4],
43
43
sprint:"1.0",
44
44
column:"backlog",
45
-
type:"feature"
45
+
type:"feature",
46
+
css:"red",
47
+
votes: [4,6,9],
48
+
comments: [
49
+
{
50
+
id:1,
51
+
userId:9,
52
+
cardId:6,
53
+
text:"Greetings, fellow colleagues. I would like to share my insights on this task. I reckon we should deal with at least half of the points in the plan without further delays.",
Copy file name to clipboardExpand all lines: docs/news/migration.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,13 +158,23 @@ description: You can learn about the Migration to Newer Versions in the document
158
158
]
159
159
~~~
160
160
161
-
~~~jsx {6} title="From v1.4"
161
+
~~~jsx {6-18} title="From v1.4"
162
162
[
163
163
{
164
164
id:1,
165
165
label:"Integration with React",
166
166
description:"Some description",
167
-
css:"red"
167
+
css:"red",
168
+
votes: [4,6,9],
169
+
comments: [
170
+
{
171
+
id:1,
172
+
userId:9,
173
+
cardId:6,
174
+
text:"Greetings, fellow colleagues. I would like to share my insights on this task. I reckon we should deal with at least half of the points in the plan without further delays.",
Copy file name to clipboardExpand all lines: docs/news/whats_new.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ Released on March 21, 2023
77
77
- The [`api.getState()`](../../api/internal/js_kanban_getstate_method) method is updated
78
78
-#### Properties
79
79
80
-
- The [`cards`](../../api/config/js_kanban_cards_config) property is extended by the ***css*** parameter
80
+
- The [`cards`](../../api/config/js_kanban_cards_config) property is extended by the ***css***, ***comments*** and ***votes*** parameters
81
81
- The [`cardShape`](../../api/config/js_kanban_cardshape_config) property is extended by the ***comments***, ***votes*** ([Example](https://snippet.dhtmlx.com/5hcx01h4?tag=kanban)) and ***css*** ([Example](https://snippet.dhtmlx.com/7fvc3rr1?tag=kanban)) parameters.
82
82
- The [`cardTemplate`](../../api/config/js_kanban_cardtemplate_config) property has an ability to display context menu
83
83
- The [`columns`](../../api/config/js_kanban_columns_config) property is extended by the ***css*** ([Example](https://snippet.dhtmlx.com/fnlvd2g5?tag=kanban)) and ***overlay*** ([Example](https://snippet.dhtmlx.com/nfv59yif?tag=kanban)) parameters
0 commit comments