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.
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.
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
is working on a reply...