Skip to content

Adding rows dynamically doesn't work. #47

@jonagh

Description

@jonagh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions