Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined board is created when using $(document).ready #137

Closed
DeveloperMarius opened this issue Aug 1, 2021 · 5 comments
Closed

undefined board is created when using $(document).ready #137

DeveloperMarius opened this issue Aug 1, 2021 · 5 comments

Comments

@DeveloperMarius
Copy link

DeveloperMarius commented Aug 1, 2021

Hey,

when I'm using the examples of jkanban everything works properly. But after I wrap it in a jQuery $(document).ready(function (){ ... }); block there is always an undefined board and when I define an item array also one undefined item per board generated.
I really don't understand why. I hope someone can help me.

<div data-id="undefined" data-order="4" class="kanban-board" style="width: 450px; margin-left: 10px; margin-right: 10px;">
  <header class="kanban-board-header">
    <div class="kanban-title-board">undefined</div>
  </header>
  <main class="kanban-drag"></main>
  <footer>
    <button class="custom-button">+ Add New Card</button>
  </footer>
</div>
<div class="kanban-item" style="cursor: default;">
  <div class="item_handle drag_handler">
    <i class="item_handle drag_handler_icon"></i>
  </div>
  <div>undefined</div>
</div>

Thank you for creating this Projekt. It really helps!

Update:
Temporary fixed it using kanban.removeBoard('undefined'); after initializing jkanban.

~ Marius

@xscode-auto-reply
Copy link

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

@Rampesna
Copy link

Rampesna commented Aug 3, 2021

<div data-id="undefined" data-order="4" class="kanban-board" style="width: 450px; margin-left: 10px; margin-right: 10px;">

Since you have defined a board whose data-id is undefined, you naturally get it in the board list as well. jKanban works with DOM objects.

Could you explain a little bit, what is the action you want to do?

@DeveloperMarius
Copy link
Author

Hello,
I think it is not important what I want to do. Just take the example project here and add jQuery to it. After that wrap the code in a $(document).ready and you will get a undefined board created.
I really don't know why.

~Marius

@riktar
Copy link
Owner

riktar commented Aug 3, 2021

@DeveloperMarius can you provide a code example where the bug is replicated?

@DeveloperMarius
Copy link
Author

Hey,
I could not reproduce this error using the example and jQuery. Maybe something else in my code was the cause of this error.
I moved away from the kanban concept for my project and used something else. So the error doesn't appear for me any more.
But thank you all!

~ Marius

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants