We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying to make an ajax call with all boards and items inside. The data coming from the ajax is json and look like this:
[ { "id": 1, "title": "New", "item": [ { "id": 1, "title": "ID1 Second line<\/strong><\/div> Thirth line View<\/div><\/div>" }, { "id": 2, "title": "ID2" }, { "id": 3, "title": "ID3" } ] }, { "id": 2, "title": "Working", "item": [ { "id": 4, "title": "ID4" }, { "id": 5, "title": "ID5" } ] }, { "id": 3, "title": "Done", "item": [ { "id": 6, "title": "ID6" } ] } ]
And the JS for init the kanban:
var kanban1 = new jKanban({ element:'#demo1', dropEl: function(el, target, source, sibling) { var _target = $(target.parentElement); var sorted = []; var nodes = kanban1.getBoardElements(_target.data("id")); var currentOrder = 0; nodes.forEach(function(value, index, array) { sorted.push({ "id": $(value).data("eid"), "order": currentOrder++ }) }); console.log(JSON.stringify(sorted)); var sourceId = $(source).closest("div.kanban-board").attr("data-id"), targetId = $(target).closest("div.kanban-board").attr("data-id"); console.log(sourceId) console.log(targetId) if(source === target) { // same column } else { // different column } }, boards : boards });
But i got the error Uncaught TypeError: Cannot read properties of undefined (reading 'dragTo') in console?
The text was updated successfully, but these errors were encountered:
I found out myself. It is because of the "id": 1. It has to be "id": "1" (See the double quotes around the numbers)
"id": 1
"id": "1"
Sorry, something went wrong.
No branches or pull requests
I am trying to make an ajax call with all boards and items inside. The data coming from the ajax is json and look like this:
And the JS for init the kanban:
But i got the error Uncaught TypeError: Cannot read properties of undefined (reading 'dragTo') in console?
The text was updated successfully, but these errors were encountered: