Skip to content

Commit 1e4c97e

Browse files
[update] the configuration guides (v2.0)
1 parent e627f48 commit 1e4c97e

File tree

1 file changed

+46
-5
lines changed

1 file changed

+46
-5
lines changed

docs/guides/configuration.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The board of Kanban consists of the *cards* distributed into *columns* and *rows
3838
:::
3939

4040
- a start date via the `start_date: boolean` config
41-
- a end date via the `end_date: boolean` config
41+
- an end date via the `end_date: boolean` config
4242

4343
:::tip
4444
You can manage the **start date** and **end date** fields of any card via the corresponding controls of the Kanban editor. If you activate these fields, the corresponding controls will be displayed in the editor automatically. To configure these controls, you can use the [**date**](#date-and-daterange-types) type.
@@ -59,7 +59,8 @@ The board of Kanban consists of the *cards* distributed into *columns* and *rows
5959

6060
- a card cover (*preview image*) via the `cover: boolean` config
6161
- a card comment(s) via the `comments: boolean` config
62-
- a card assignment (users) via the `users: { show: boolean, limit: number, showLimit: boolean, values: object }` config
62+
- a card vote(s) via the `votes: { show: boolean, clicable: true }` config
63+
- a card assignment (users) via the `users: { show: boolean, values: object, maxCount: number }` config
6364

6465
:::tip
6566
You can assign one or several users to any card via the corresponding control of the Kanban editor. To configure the control for assigning a single user, use the [**combo** or **select**](#combo-select-and-multiselect-types) types of editor. To assign multiple users, use the [**multiselect**](#combo-select-and-multiselect-types) type.
@@ -125,7 +126,11 @@ Unless you specify the card settings via the [`cardShape`](api/config/js_kanban_
125126

126127
## Editor
127128

128-
The *Editor* of Kanban consists of the fields for managing the cards data. To configure the editor fields (controls), you can use the [`editorShape`](api/config/js_kanban_editorshape_config.md) property. You can use the following types of the editor fields:
129+
:::info
130+
You can display the Editor as the **sidebar** or **modal window** using the [`editor.placement`](api/config/js_kanban_editor_config.md) property!
131+
:::
132+
133+
The *Editor* of Kanban consists of the fields for managing the cards data. To configure the editor fields (controls), you can use the [`editorShape`](api/config/js_kanban_editorshape_config.md) property. You can use the following types of editor fields:
129134

130135
- [**combo**, **select**, and **multiselect**](#combo-select-and-multiselect-types)
131136
- [**color**](#color-type)
@@ -508,11 +513,47 @@ const board = new kanban.Kanban("#root", {...});
508513
new kanban.Toolbar("#toolbar", {
509514
api: board.api,
510515
items: [
511-
"search", // search bar
516+
{ // custom search bar
517+
type: "search",
518+
options: [
519+
{
520+
id: "label",
521+
label: "By label"
522+
},
523+
{
524+
id: "start_date",
525+
label: "By date",
526+
searchRule: (card, value, by) => {
527+
const date = card[by];
528+
return date?.toString().includes(value);
529+
}
530+
}
531+
],
532+
resultTemplate: kanban.template(searchResult => {
533+
return `<div class="list-item">
534+
<div class="list-item-text">${searchResult.result.label}</div>
535+
${searchResult.result.description ? `<div class="list-item-text item-description">${searchResult.result.description}</div>` : ""}
536+
</div>`
537+
})
538+
},
512539
"spacer", // empty space
513540
"undo", // control to undo the card operations in the history
514541
"redo", // control to redo the card operations in the history
515-
"sort", // control for sorting cards
542+
{ // custom sort control
543+
type: "sort",
544+
options: [
545+
{
546+
text: "Sort by label",
547+
by: "label",
548+
dir: "asc"
549+
},
550+
{
551+
text: "Sort by description",
552+
by: "description",
553+
dir: "desc"
554+
}
555+
]
556+
},
516557
"addColumn", // control for adding new columns
517558
"addRow", // control for adding new rows
518559
// custom elements

0 commit comments

Comments
 (0)