riktar / jkanban

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

Add Board Button in Boards #118

Closed Rampesna closed 3 years ago

Rampesna commented 3 years ago

I want to create 'add new board' button at the all other boards right side

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

marcosrocha85 commented 3 years ago

boards.title is a property that accepts HTML, you can add buttons there as you wanted. See https://jsfiddle.net/marcosrocha85/Lk9t483r/

Rampesna commented 3 years ago

My solution is; { 'id': '0', 'order': 99999, 'title': '

New Boards
', 'class': '', 'dragBoards': false }

After Add:

kanban.removeBoard('0'); kanban.addBoards([ { id: '0', order: 99999, title: '

Yeni Pano
', dragBoards: false } ]);

Is there an easier way?

marcosrocha85 commented 3 years ago

I guess I don't understanding you. You want to add a new board at the most right of kanban or you want to add a button at every board title?

Rampesna commented 3 years ago

https://ibb.co/V9ZpFBj

This is my screen, when I click the 'Yeni Pano' button, I want to create a new board and then the 'Yeni Pano' button will remain on the far right of all boards.

My solution is;

var kanban = new jKanban({ element: '#tasks', widthBoard: '290px', dragBoards: true, click: function(el) {/* */}, dropEl: function (el, source) {/* */}, dragendBoard: function (el) {/* */}, boards: [ /* Other Boards */ { 'id': '0', 'order': 99999, 'title': '<button>Yeni Pano (Add New Board)</button>', 'dragBoards': false } ] });

When clicked (Add New Board) button i delete the board with the id value of 0 (this is my for my Add New Board Button) and create it again. I'm doing this so that my 'Add New Board Button' can stay on the far right.

marcosrocha85 commented 3 years ago

Now I could understand you. I guess the best way is the way you're doing because of the current behavior of jKanban. I think would be nice if jKanban had a button to add a board like that, so pull requests are welcome. Oh, and nice board btw. ;)

Rampesna commented 3 years ago

Thank you for your nice thought :) As I said, I just wanted to know if there is an easy solution :)