Component state in slot doesn't change when paging/sorting/filtering
See original GitHub issueI have the following (products) table:
<b-table :fields="fields"
:items="findAllProducts"
:current-page="currentPage"
:per-page="perPage"
:filter="filter"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc">
<template slot="price" scope="data">
<price-editable :product="data.item"></price-editable>
</template>
</b-table>
findAllProducts
is a provider function that does an http request based on the current page/sort/filter. price-editable
is a custom component that renders an inline editable price field.
Now, when I do paging/sorting/filtering, the state (data
) inside the price-editable
component stays the same. It doesn’t re-render, but keeps the state of the ‘previous’ row.
How can I force to re-render a component inside a slot when paging/sorting/filtering?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
React table with sorting and pagination doesn't update
First: don't assign state by this.state['arg']= . It's a bad practice. Use this.setState() instead. Second: this.setState() it's ...
Read more >Python-Driven Filtering, Paging, Sorting
With backend paging, we can have front-end sorting and filtering but it will only filter and sort the data that exists on the...
Read more >Table | Components
All click related and hover events, and sort-changed events will not be emitted when the table is in the busy state. Busy styling...
Read more >Quasar Vue's QTable (3/6) - Loading State, Pagination, and ...
... and I'll teach you all 72 of Quasar's components ! ... Quasar Vue's QTable (3/6) - Loading State, Pagination, and Sorting.
Read more >Table
The QTable Vue component allows you to display data in a tabular manner and ... If you don't need pagination, sorting, filtering, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alexsasharegan @mosinve Thanks! Adding the
:key="data.item.id"
prop solved my problem. Really the kind of solution I was hoping for!Vue is really intelligent about reusing components for performance. Usually a new key would trigger a new component. Maybe try to add a key on your custom component based on your item id or something unique in your record.