riktar / jkanban

Vanilla Javascript plugin for manage kanban boards
https://www.riccardotartaglia.it/jkanban/
Apache License 2.0
1.07k stars 297 forks source link

Feature Request: Add Elements to Item #86

Closed rayoray closed 4 years ago

rayoray commented 4 years ago

Is it possible to add additional elements to the item (example: Labels) and have it displayed on the card?

"item"  : [                                       // item of this board
            {
                "id"    : "item-id-1",                // id of the item
                "title" : "Do Something!"            // title of the item
                "label" : [                         // labels of the item
               {
                 "name": "label 1",
                  "color": "00ac0f",
               }
                ],
            },
        ]

image

lb- commented 4 years ago

@rayoray - the docs do not state it explicitly, but anything you put in the title attribute will be added as children of the item element. This includes html.

For example, the following will render the html in the board's item.

"item"  : [
  {
    "id": "item-id-1",
    "title" : "<div>Do Something!</div><div class="labels><span style="background-color: 00ac0f;">Label 1</span></div>"
  },
]
riktar commented 4 years ago

@lb- was right! Close