I want to create a ember table component whose value is updated dynamically [Ember.js]

739 views Asked by At

when i bind a tracked variable to the ember table, this is the error that i get

Error: Assertion Failed: You attempted to update rows on <(unknown):ember472>, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.

rows was first used:

So how do i go about creating a table which changes the value according to the value in the tracked variable

this is the controller side

@tracked rows = this.model.row

this is the component side

<EmberTable as |t|>
  <t.head @columns={{@columns}} @widthConstraint="eq-container" />
  <t.body @rows={{@rows}} as |b|>
    <b.row as |r|>
       <r.cell as |value|>
         {{value}}
       </r.cell>
    </b.row>
  </t.body>
</EmberTable>

i passed the row variable to the component and the table rendered just fine.

but at times the values inside the model.data changes and then this error occurs

0

There are 0 answers