Saving selection - Dropdown prevalue for custom datatype
Hi all,
I have created a custom datatype that is essentially a drop-down document type selector. The problem I have is when I select a value and save it, the page does a mini-refresh and the select field is cleared. How do I get angular to reflect the selection I made upon this refresh?
first double check that model.value does contain a saved value which will re-populate the selectBox. Then I would suggest you might have more luck with the 'ng-options' attribute in angular instead of ng-repeat. so the code might be.
<select name="selectedType" ng-model="model.value" ng-options="item.Name for item in documentTypes track by item.alias" required>
Saving selection - Dropdown prevalue for custom datatype
Hi all,
I have created a custom datatype that is essentially a drop-down document type selector. The problem I have is when I select a value and save it, the page does a mini-refresh and the select field is cleared. How do I get angular to reflect the selection I made upon this refresh?
My code can be found below:
Package.Manifest
DocumentTypeSelectorEditor.html
DocumentTypeSelector.controller.js
Solved the problem with this:
first double check that model.value does contain a saved value which will re-populate the selectBox. Then I would suggest you might have more luck with the 'ng-options' attribute in angular instead of ng-repeat. so the code might be.
Unfortunately, this didn't work for me so I ended up doing this instead:
is working on a reply...