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

Uncaught TypeError: Cannot read property 'dataset' of null #123

Closed justkidding96 closed 2 years ago

justkidding96 commented 3 years ago

Hi I've got an error sometimes when initializing the kanban.

This line triggers the error: document.querySelector(e.options.element).dataset.hasOwnProperty("board") ? (url = document.querySelector(e.options.element).dataset.board,

Could you explain what I'm doing wrong?

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

When are you initializing jKanban? While page loading of after page completely loaded?

justkidding96 commented 3 years ago

@marcosrocha85 I have a Vue application. When I get a successful response I create multiple items with the createItem method and then I initialize jKanban.

justkidding96 commented 3 years ago

@marcosrocha85 Any updates about this issue?

marcosrocha85 commented 3 years ago

Reading your comment again, what are you mean with "I create multiple items with the createItem method and then Iinitialize jKanban"? I just can't understand how are you doing. You call new jKanban just only once (after page finishes load), even using Vue. What you have to do is delete/create items according your service return. I used jkanban in a project almost like that and had no issue. What your createItem function does?