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

Header of kanban boards - adding a button #175

Closed Brecht272727 closed 1 year ago

Brecht272727 commented 1 year ago

Hi, is it possible to add something to the header with the title inside? I want to add an edit button so we can change the title of the board via ajax.

I know it is possible to use this:

itemAddOptions: {
    enabled: true,                                              // add a button to board for easy item creation
    content: '+',                                                // text or html content of the board button   
    class: 'kanban-title-button btn btn-info btn-sm',         // default class of the button
    footer: false                                                // position the button on footer
},

But this way i can't add an data-id attribute for knowing the board id. I am also trying to use <i class="fa fa-edit"></i> as content item, but it gives me the html instead of an icon.

marcosrocha85 commented 1 year ago

If you include bootstrap (or font-awesome) script AFTER your loading code. It should work. Remember, jKanban is a vanilla javascript plugin, so in order to make it work with another plugins (such as Font Awesome) you have to manage another plugin functions manually.

Brecht272727 commented 1 year ago

Yes i know, i have loaded font awesome plugin. But it shows me the HTML like <i class="fa fa-edit"></i> instead of showing me the edit icon. And can you tell me what about the other question: 'But this way i can't add an data-id attribute for knowing the board id.'

WriterStat commented 1 year ago

Hi @Brecht272727, Marcos

The JKanban Option : content: '+', appears to treat everything like text. At least it has for us. So adding HTML there might come out as text. Depending on what version of the library you have.

You may need to do this outside of the library. Just a heads up. Using the library as a base.

Brecht272727 commented 1 year ago

Hi @WriterStat I have the latest version and it comes out as text. Thanks for the reply. I will try to do this outside of the library.

marcosrocha85 commented 1 year ago

That's I was trying to say. I had to develop every "custom" feature and used jKanban only as a main lib.