File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,15 @@ description: You can learn about the set-edit event in the documentation of the
1313### Usage
1414
1515~~~ jsx {}
16- " set-edit " : ({ cardId: string | number } | null ) => void ;
16+ " set-edit " : ({ cardId: string | number, eventSource : " select-card " } | null ) => void ;
1717~~~
1818
1919### Parameters
2020
2121The callback of the ** set-edit** event can take the * null* value or an object with the following parameter:
2222
2323- ` cardId ` - (required) the ID of the card to be edited
24+ - ` eventSource ` - (required) the *** "select-card"*** action that invokes the *** set-edit*** event
2425
2526::: note
2627The *** null*** value is used when closing editor
@@ -38,10 +39,12 @@ const board = new kanban.Kanban("#root", {
3839 columns,
3940 cards
4041});
41- // subscribe on the "set-edit" event
42- board .api .on (" set-edit" , (obj ) => {
43- console . log (obj) ;
42+ // prevent editing card when a user click the card once
43+ board .api .intercept (" set-edit" , ({ eventSource } ) => {
44+ return eventSource != " select-card " ;
4445});
4546~~~
4647
47- ** Change log:** The event was added in v1.2
48+ ** Change log:**
49+ - The event was added in v1.2
50+ - The *** eventSource*** parameter was added in v2.0
You can’t perform that action at this time.
0 commit comments