Peter, thank you for your answer!
I was trying to do it that way, the problem is I'm not sure how to set the
selected deployment as True when selected.
How can I find an element in a List and change it? with a map maybe?
On Saturday, September 17, 2016 at 12:43:38 PM UTC+3, Peter Damoc wrote:
> viewDeploy: (String, Bool) -> Html Msg
> viewDeploy (deployment, isSelected) =
> [ classList [("selected", isSelected)], onClick (DeploySelected
> deployment) ]
> [ text deployment ]
> viewDeployments : List (String, Bool) -> Html Msg
> viewDeployments deployments =
> ul  ( List.map viewDeploy deployments )
> This is one way to do it.
> On Sat, Sep 17, 2016 at 12:14 PM, Roni Hacohen <ronih...@gmail.com
>> I'm wondering what is the best solution for my problem,
>> I have a List of deployments, once the user choses a deployment he will
>> get more details about it,
>> the view looks like this:
>> viewDeploy: String -> Html Msg
>> viewDeploy deployment =
>> [onClick (DeploySelected deployment)] [ text deployment ]
>> viewDeployments : List String -> Html Msg
>> viewDeployments deployments =
>> ul  ( List.map viewDeploy deployments )
>> Now, I want to add a classList to the li that will change its color,
>> what is the best way to mark that deployment as selected?
>> You received this message because you are subscribed to the Google Groups
>> "Elm Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> For more options, visit https://groups.google.com/d/optout.
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
You received this message because you are subscribed to the Google Groups "Elm
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.