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

Adding rows dynamically doesn't work.

Open jonagh opened this issue 7 years ago • 0 comments

I try to add a new row of data dynamically and it doesn't reflect into the data table html.

Using the basic example code (fruit/color table),

I try to do something like... myDataTable.data.push({ fruit: 'banana', color: 'yellow' }) which doesn't work, but I kind of expected that since simple observers don't trigger for sub elements, but I thought something like this should work... myDataTable.push('data', { fruit: 'banana', color: 'yellow' }) however it doesn't work either.

So, how can I add (or remove) rows dynamically?

Note that assigning an entirely new array to the data property does work, but that seems cumbersome and inefficient.

Thanks.

jonagh avatar Jul 11 '17 21:07 jonagh