Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #111873
    Scott Arnold
    Participant

    There seems to be a massive bug with the table updateRow method in combination with sorting.

    See JSFiddle here:  https://jsfiddle.net/0b9utmLj/

    In the fiddle, sort by name until Item C is at the top of the table.  Then click the Update Item C button.  Notice how both the first and third rows update to Item C2.

    This is on community version 20.0.2

    • This topic was modified 1 day, 10 hours ago by Scott Arnold.
    #111875
    admin
    Keymaster

    Hi Scott,

    The code should be updated like this:

    document.querySelector('button').onclick = () => {
      const table = document.getElementById('table');
      const state = table.saveState();
      table.clearSort();
    	table.updateRow('c', {id: 'bc', name: 'Item C2'});
      table.loadState(state);
    }

    Regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

    #111877
    Scott Arnold
    Participant

    Thank you for the example of how to perform a row update, and for the prompt reply. It’s possible I just missed it, but I didn’t see anywhere in the documentation that explains why and how to do what you have shown here; I would recommend improving the documentation on table state and methods for updating the table. I didn’t see any how-to documentation on this, and the API docs for methods like updateRow and saveState do not provide such information. Across the board, the limited documentation makes it hard to properly utilize the APIs, and can make it look like components have bugs when really it’s just not understanding how the components and their APIs are supposed to operate. Some improvements to the documentation could alleviate such issues, and make your components more accessible to developers who do not already have experience with them.

    Other than that, the components have been excellent.

    Thank you,

    – Scott

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.