How do I set which item is selected? I have tried setting value to 1 (above) expecting Option 2 to be selected but when the page loads the items are present but none of them are selected.
I have been trying to work this out for hours..... maybe I will have to make my own version of the property editor, then I can change the HTML with out worrying.... it must be possible as umbraco does it.....
Umbraco.DropDown - Set the selected value in custom Angular View (custom back office section)
Hi Guys I am reusing the 'Umbraco.DropDown' property editor in my custom angular view I am using the directives like this:
and this is what I am passing in:`
How do I set which item is selected? I have tried setting value to 1 (above) expecting Option 2 to be selected but when the page loads the items are present but none of them are selected.
I have seen this post:
https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/81580-custom-section-reuse-datatype-dropdownlist
but the solution invloves changing the Angular View but in my case I want to reuse the umbraco's view and don't want to change this file.
So how do I:
Select the option that I want selected when the page loads, without making changings to the HTML in the property editor.
I have been trying to work this out for hours..... maybe I will have to make my own version of the property editor, then I can change the HTML with out worrying.... it must be possible as umbraco does it.....
any other suggestions?
Hi
it could be a type thing ?
looking at the code for the dropdownlist - this should work - as it does
looking at the code above - your value is
and your items are
so model.value is an int and the item.id is a string - It doesn't always make a difference but it might in this case?
I tried changing
to
Still doesn't work
Really ripping my hair out now.
is working on a reply...