dbsimmons64

dbsimmons64

Flop - displayed inserted record in correct place

Hi All

I’m using the amazing flop/flop_phoenix libraries for pagination. I’m using liveview streams to retrieve a list of customer transactions ordered by a date field. The pagination works really well but when I create a record it gets inserted at the bottom of the current paginated list i.e. it doesn’t take account of the date entered. If I reresh the page all works well and my new record appears in the correct place.

Does anyone know if it is possible to retrieve the newly created record but in the correct place in the paginated order.

As an example. If I create a record with a date that would normally appear on Page 5 of my paginated list but I’m looking at Page 2 when I create the record I’d really like the display to update/jump to Page 5.

cheers

Dave

Most Liked

dbsimmons64

dbsimmons64

Thank you so much @|sodapopcan. I’ve been thinking about this for a few days now and coming to the same conclusion as yourself (reset the stream and relaod the records).

cheers

Dave

Where Next?

Popular in Questions Top

RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44139 214
New

We're in Beta

About us Mission Statement