riktar / jkanban

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

Is there an example of an item with a card layout with multiple fields? #106

Closed rouilj closed 3 years ago

rouilj commented 3 years ago

How would I create a kanban item with the following structure:

Title: Present delivery
Owner: rouilj  <avatar image of rouilj>
Due date: 2020-12-25

It looks like the title property is a single line text string. I can add the owner, dueDate ownerAvatar as custom properties, but how do I get them displayed in the item/card?

Can the

customHandler       : "<span class='item_handle'>+</span> %s"// your entirely customized handler. Use %s to position item title

property be used in some way to format the item? I don't see any doc on the customHander but I assume it is meant to provide a handle to click on to start drag and drop. Otherwise the whole item/card accepts a click to drag and drop.

xscode-auto-reply[bot] commented 3 years ago

Thanks for opening a new issue. The team has been notified and will review it as soon as possible. For urgent issues and priority support, visit https://xscode.com/riktar/jkanban

rbmcgowan commented 3 years ago

@rouilj did you find anything on how to do this ? I want to do the same, can't see any obvious way to do so

rouilj commented 3 years ago

Hi rbmcgowan:

In message riktar/jkanban/issues/106/740419591@github.com, rbmcgowan writes:

@rouilj did you find anything on how to do this ? I want to do the same, can't see any obvious way to do so

Didn't find a way to do this. Waiting on a response from the developer.

-- -- rouilj John Rouillard

My employers don't acknowledge my existence much less my opinions.

riktar commented 3 years ago

If you want customize the card content, you can insert your html in title properties of boards object.

Here ana example:

"item"  : [                           // item of this board
            {
                "id"    : "item-id-1",
                "title" : "<h1>Hello Boys</h1>"            // title of the item
                "class" : ["myClass",...]
            },
            ...
]
rbmcgowan commented 3 years ago

thanks for the response @riktar, appreciated.

rouilj commented 3 years ago

Ah ok. Is the title injected with innerHTML into the card? I'll give it shot thanks.