Copied to clipboard

Flag this post as spam?

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


  • seanrock 260 posts 481 karma points
    1 day ago
    seanrock
    0

    Dropdown list for data list type issue

    Hi

    Hi, I have created a datatype for the datalist with a dropdown for the editor type. I have turned off allow empty because I want the first item in the list selected however in some of our environments it still shows an empty first item.

    This works on my local machine and some of our deployment environments, not all, which odd. I've checked the instances where it doesn't work, by not working i mean its showing an empty first item. If i inspect the property on that environment it appears correctly configured. I've removed all cache files etc and deployed it several times, still not working consistently.

    Anything else I can try?

    Thanks.

  • Lee Kelleher 4025 posts 15834 karma points MVP 13x admin c-trib
    1 day ago
    Lee Kelleher
    0

    Hi Sean,

    Unfortunately it's a quirk of AngularJS, (not Data List itself), that it adds an empty <option> if there is no initial value.

    More info here: https://stackoverflow.com/questions/12654631/why-does-angularjs-include-an-empty-option-in-select

    The only way I'd been able to set an initial value is by hooking into the EditorModelEventManager.SendingContentModel notification in C#.

    Hope this helps?

    Cheers,
    - Lee

Please Sign in or register to post replies

Write your reply to:

Draft