Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nick 42 posts 155 karma points
    Feb 27, 2019 @ 11:41
    Nick
    0

    Get Text value for DropDown field in custom ListView Layout

    Hi,

    I am using Umbraco 7 and following the tutorial at https://24days.in/umbraco-cms/2016/custom-list-view-layouts/ for creating a custom ListView Layout.

    I have a custom DropDown field populated with prevalues and want to display it in the list view, however the listview shows the id stored, not the text prevalue:

    enter image description here

    How can I get the text prevalue in the angular controller. e.g. in Razor you could use something like @umbraco.library.GetPreValueAsString(Model.YourProperty)

    Thanks,

    Nick

  • Peter Sinke 12 posts 83 karma points
    1 day ago
    Peter Sinke
    0

    The question is 5 years old at this point, but I ran into the same problem.

    The solution is to take the first value from the array like so: {{value[0]}}

    In the listview you would set it like this: umbraco listview dropdown value

    Hope this helps someone.

Please Sign in or register to post replies

Write your reply to:

Draft