paper-datatable icon indicating copy to clipboard operation
paper-datatable copied to clipboard

Rerender a row in a table after underlying data model change

Open vsobolmaven opened this issue 8 years ago • 1 comments

I need to update data for a row externally and have it re-render in the table.

Need something like this:

        var _datatable = document.querySelector('paper-datatable');
        var data = _datatable.get('data');
        var model = data[0];
        model.my_attr = 'New Value';
        // Re-render the row - won't work.
        _datatable.set('data.1', model);              
        // This won't work neither.
        //_datatable.set(['data', index, _datatable.idProperty], 1);

I tried to work through from implementation of _triggerSave() in paper-datatable-card.html, but without any effect. How do I do that properly?

Thanks!

vsobolmaven avatar Apr 05 '16 09:04 vsobolmaven

Hi! Try to set right row number: this.$.paperDatatable.set('data.#1.author', 'Tom'); I find it example on docs page Getting started and it help me with a same problem)

dhrytsenko avatar Apr 14 '16 21:04 dhrytsenko