question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Board items not updating?

See original GitHub issue

Hi,

I’m trying to understand why this doesn’t work. So basically, I have 3 boards. The first board has 3 items in. In my function I have these callbacks:

                dragendBoard: function(el) {
                  updateSortOrders();
                },
                dragendEl: function(el) {
                  updateSortOrders();
                }

Then this function that gets called:


function updateSortOrders() {
  console.dir({ setup: KanbanTest.options.boards });
}

The issue is that for some reason KanbanTest.options.boards remains the same output, even when I have moved items?

This is how it looks when we init the page: https://ibb.co/WfmCYXh This is what I see in updateSortOrders() with the dump: https://ibb.co/GRksjF1 Here is how it looks after I move one item into another slide: https://ibb.co/Y2j3pKn

The problem is that the dump of the boards looks exactly the same (i.e the entry hasn’t been moved into the 2nd one).

Am I missing something?

Thanks!

Andy

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
youraddscommented, Feb 6, 2020

Just as an update - below is the code I managed to get working - just in case its useful to someone in the future 😃

  var boards = Array.from(document.querySelectorAll(".kanban-container .kanban-board"));

  var updatesToSend = new Array();

  boards.forEach(function (board, i) {

    console.dir( { board: board });

    // get the board id and title 
    var board_id = board.getAttribute("data-id");
    var board_title = document.querySelectorAll(`.kanban-board[data-id="${board_id}"] .kanban-title-board`)[0].innerHTML;

    // get each of the elements in this one...
    var allEle = KanbanTest.getBoardElements(board_id);
    var the_items = new Array();
    allEle.forEach(function(item, i_item) {

      var theContents = item.innerHTML;
      theContents = theContents.replace("<div class=\"item_handle drag_handler\"><i class=\"item_handle drag_handler_icon\"></i></div><div>","");
      theContents = theContents.replace("</div>","");

      the_items.push({ sort_order: i_item+1, contents: theContents });

    });

    updatesToSend.push({ board_id: board.getAttribute("data-id"), board_title: board_title, sort_order: i+1, items: the_items });

  });

  var the_setup = JSON.stringify(updatesToSend);

This includes the boards (in their current order), and then the items also in their order. I then send this to our server, and do the magic on there in terms of updating the records

0reactions
youraddscommented, Feb 5, 2020

😦 Thanks for the quick response though.

Unfortunately, I’m good at using modules, but not so much at editing them / making forks 😃 So I’ll just have to make do with the other method I had.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Board Column Done' values are not updating correctly
The values assigned to Kanban Board Column, Board Column Done, and Board Lane fields may differ from what you expect when another team...
Read more >
Visual task board not updating - ServiceNow Community
Hi, My manager has a Flexible VTB for the tasks assigned to the ServiceNow admins group. Unfortunately, the board doesn't bring in new ......
Read more >
Issues not updating in backlog or sprint in classic project
For some reason the Active sprints part of the board is working properly, but when I view the Backlog it is completely wrong....
Read more >
Send update info to update of the connected item in another ...
Hi, Currently, I update work details in high level board, and when I assign a task for a department, an item is created...
Read more >
Solved: Update Item Not Working - Power Platform Community
Update Item Not Working. ‎10-10-2018 06:25 AM. I need a flow to send an approval when a specific field is amedned in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found