CessK
Datatables like data entry with LiveView
Hello Everyone,
I have a question about table like data entry. And to make it as smooth as possible for the end user to add, edit and remove rows.
In previous projects i have done i have used Jquery data tables with a C# backed.
This worked very well. However i am unable to find something similar.
I have googled around and the best i could find was a 2 year old library:
I think Live View is the way to go here to implement something similar.
The use case for this would be something like a Purchase Order.
I have the main Purchase Order information and a table for the items. I would like to be able to add, update or remove items from this table.
And then able to submit a form to the _live.ex to save them as 1 object.
If there is something like this I would love to hear it as google has failed me on this.
Thanks for any information in advance!
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #performance










Marked As Solved
mmmrrr
So I just bootstrapped a new project called Example and generated a new resource:
mix phx.gen.live Billing Order orders title:string positions:array:mapbased on the assumption, that you want an embedded list of positions inside of your data schema.Next you need to adjust the data model. This should always be your guiding principle: Model first!
Then you’ll need to adjust the generated form component (of course this doesn’t have to be in a modal, I simply kept it that way for ease of implementation:
I hope this helps you to grok the connection between schema, changeset and form a little better.
Also Liked
CessK
@mmmrrr Ahh yes now i understand how it all fits together
I see now how you used field set to do the same thing i did with multiple forms.
This will help me out greatly. Thank you for the time to write this out.