dwyl / checklist

A shared checklist.
GNU General Public License v2.0
7 stars 0 forks source link

Update List using Phoenix Live View #2

Closed nelsonic closed 5 years ago

nelsonic commented 5 years ago

Read: https://elixirschool.com/blog/phoenix-live-view and https://github.com/dwyl/phoenix-live-view-counter

Todo

nelsonic commented 5 years ago

This seems relevant: https://dennisbeatty.com/2019/04/24/how-to-create-a-todo-list-with-phoenix-liveview.html

nelsonic commented 5 years ago

Trying out this basic counter example: https://dennisbeatty.com/2019/03/19/how-to-create-a-counter-with-phoenix-live-view.html On: https://github.com/dwyl/live-view-counter

nelsonic commented 5 years ago

Hi @RobStallion I'm attempting to in-line the status <select> on the todos index page:

image

I can't get the phx-change to fire when the <select> is updated. Can you help?

nelsonic commented 5 years ago
          <select>
            <%= for status <- statusliststring() do %>
              <option phx-value="<%= todo.id %>_<%= status %>"
                      value="<%= status %>"
                      <%= selected(todo.status, status) %>
              >
                <%= human_readble_status(status) %>
              </option>
            <% end %>
          </select>
nelsonic commented 5 years ago

Works!! image