question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handling adding items dynamically

See original GitHub issue

Hi,

I have a problems with the view when updating collection. I have created a setup where I can endlessly swipe through dates (disabled the infinite scroll option). So what I did was create a collection with three dates and set the selected index on the middle one. On the CardsViewItemSwipedHandler I then handled the right or left swipe and based on that do the following:

right swipe (previous date)

  1. Add a new date on index 0 and remove the last date

leftswipe (nextdate)

  1. Add a new date at the end and remove the date on index 0

This seems to be working for the first few swipes but after that the views gets of center (content is not completly shown). Do you have a suggestion how I can solve this ?

Thank you

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
martinvds81commented, Nov 6, 2018

@martinvds81 don’t forget)

I changed the setup yesterday and is seems to be working now. Instead of adding and removing the items in the carousel, they now have some fixed items and enabled cyclic again. In the CardsViewItemSwipedHandler I now only register the left or right action and based on that reload the bindable data in the card.

Anway thanks for this control and your help 👍

0reactions
AndreiMisiukevichcommented, Nov 6, 2018

@martinvds81 enjoy it 😃

– if you like this plugin, you may STAR it ))

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add objects into objects dynamically in javascript?
Here is a small example that I think might help you. This creates objs with dynamic names and values and adds them to...
Read more >
Dynamically creating JavaScript elements with event ...
This tutorial explores the concepts of events, event listeners, and dynamically creating new JavaScript elements by using document.
Read more >
javascript - Adding <li> items dynamically to a to-do list
For a homework assignment, I have to create a "TO-DO" list, which will add a list item to the unordered list dynamically using...
Read more >
Using JavaScript - Dynamically Add & Remove List Items
Dynamically Add & Remove List Items | Using JavaScript - (Sourcecode) · Kazy TV · How To Prevent Numbers In Input Field |...
Read more >
How to add elements to an existing array dynamically in ...
We will discuss two methods in this article i.e. push() method and dynamically adding an element at any index using the index of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found