You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use the collectionManager on a Vue3 project to create a collection that can be called multiple times with different page size. For that, i tried to define my collection like exporting the pagination object, a common practice seen in other project when using filters, to change the value of the filters on a view before doing collection.refresh().
Somehow, the collection seems to not take the change of size in pagination properly. My first refresh was executed with the updated pageSize value, but all the other ones used the same value, ignoring the new definition before calling refresh again. The library seems to have some issues supporting this type of dynamic pagination with pageSize changing.
This issue can be discarded as a wrong use of the library, but i wanted to create it anyway to check if it's a bug or rather a wrong use of collection library
Full example can be seen on FansForumPR.
I will add some pseudo-code to show the example:
Hello, thanks for this note, I believe the change is related to Vue3, you should be able to get it working by wrapping the pagination in a computed property.
That being said we are slowly deprecating the collectionManager in favor of the tanstack set up. Let me know if you want me to walk you through a typical workflow. https://www.notion.so/thinknimble/TanStack-Vue-with-List-View-8c66fe92769a4168a8ad2cb174de9e85
I was trying to use the collectionManager on a Vue3 project to create a collection that can be called multiple times with different page size. For that, i tried to define my collection like exporting the pagination object, a common practice seen in other project when using filters, to change the value of the filters on a view before doing collection.refresh().
Somehow, the collection seems to not take the change of size in pagination properly. My first refresh was executed with the updated pageSize value, but all the other ones used the same value, ignoring the new definition before calling refresh again. The library seems to have some issues supporting this type of dynamic pagination with pageSize changing.
This issue can be discarded as a wrong use of the library, but i wanted to create it anyway to check if it's a bug or rather a wrong use of collection library
Full example can be seen on FansForumPR.
I will add some pseudo-code to show the example:
api.ts file:
export const modelFunctions = () => { const modelFilters = { premium: false, } const modelPagination = new Pagination({ size: 10 }) const modelCollection = createCollectionManager({ fetchList: modelApi.list, filters: modelFilters, pagination: modelPagination, }) return { modelCollection, modelFilters, modelPagination, } }
By updating the property size for modelPagination in a view, it only works sometimes, proving to not take into consideration future updates.
The text was updated successfully, but these errors were encountered: