Open SebastianCBA opened 7 years ago
Do you want the user to be able to add an item to the list or do you need to programmatically add an item to the list?
If the second one, I think you should just be able to do a economies.push(<your new object>)
Yes, I want the user to be able to add an item to the list
Like http://embed.plnkr.co/GLuyC0jpIdiEXB6R4FIa/preview
But I do not know how to apply it.
ui-select is supported, please see the documentation.
Yes..
<div editable-ui-select="sectorSheet.economy_id" data-e-form="rowform" data-e-name="economy_id" name="economy_id" theme="bootstrap" data-e-ng-model="sectorSheet.economy_id">
[[ showEconomy(sectorSheet) ]]
<editable-ui-select-match placeholder="Select">
[[showEconomy(sectorSheet) || $select.search]]
</editable-ui-select-match>
<editable-ui-select-choices repeat="economy in (search_economies | filter: {text: $select.search}) track by economy.id">
[[ economy.text ]]
</editable-ui-select-choices>
</div>
It seems to work as an example, but how to add a new economy? Or write a value that does not exist in the dropdown?
You need to use tagging. Please see the ui-select documentation.
I have a listbox that gets the data from the database:
I need to be able to add a new value to the dropdown. Some help will be very grateful